Skip to content

Commit

Permalink
Update utils/coins.go
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Johnson <[email protected]>
  • Loading branch information
Joe Bowman and Alex Johnson authored Mar 10, 2023
1 parent 70318b9 commit 62b092c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/coins.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ func CoinFromRequestKey(query []byte, accAddr sdk.AccAddress) (sdk.Coin, error)

func DenomFromRequestKey(query []byte, accAddr sdk.AccAddress) (string, error) {
balancesStore := query[1:]
accAddr2, denom, err := banktypes.AddressAndDenomFromBalancesStore(balancesStore)
gotAccAddress, denom, err := banktypes.AddressAndDenomFromBalancesStore(balancesStore)
if err != nil {
return "", err
}

if !accAddr2.Equals(accAddr) {
return "", fmt.Errorf("account mismatch; expected %s, got %s", accAddr.String(), accAddr2.String())
if !gotAccAddress.Equals(accAddr) {
return "", fmt.Errorf("account mismatch; expected %s, got %s", accAddr.String(), gotAccAddress.String())
}

return denom, nil
Expand Down

0 comments on commit 62b092c

Please sign in to comment.