Finschia / finschia-sdk

A framework for building blockchains based Finschia Mainnet that is forked from cosmos-sdk
Apache License 2.0
63 stars 30 forks source link

fix: use accAddress to compare in validatebasic function in collection & token modules #1288

Closed 170210 closed 4 months ago

170210 commented 4 months ago

Description

This PR uses accAddress instead of address to compare in the validatebasic function in the collection & token modules. Before this PR, it used case-sensitive comparison, thus it would occur a bug when holder and operator are the same but in different capitalization.

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.42%. Comparing base (5636259) to head (bda7705). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1288/graphs/tree.svg?width=650&height=150&src=pr&token=m16qfzIPO7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) ```diff @@ Coverage Diff @@ ## main #1288 +/- ## ========================================== + Coverage 70.41% 70.42% +0.01% ========================================== Files 643 643 Lines 54693 54701 +8 ========================================== + Hits 38512 38525 +13 + Misses 14009 14006 -3 + Partials 2172 2170 -2 ``` | [Files](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1288?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) | Coverage Δ | | |---|---|---| | [x/collection/msgs.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-eC9jb2xsZWN0aW9uL21zZ3MuZ28=) | `98.31% <100.00%> (+0.69%)` | :arrow_up: | | [x/token/msgs.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-eC90b2tlbi9tc2dzLmdv) | `100.00% <100.00%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1288/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)