Skip to content

Commit

Permalink
chore: prevent any proposal with different denom
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeseung-bae committed May 3, 2024
1 parent 9854cf3 commit 472d5b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/fswap/types/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"gopkg.in/yaml.v2"

sdkerrors "github.com/Finschia/finschia-sdk/types/errors"
bank "github.com/Finschia/finschia-sdk/x/bank/types"
gov "github.com/Finschia/finschia-sdk/x/gov/types"
)
Expand Down Expand Up @@ -45,5 +46,9 @@ func (m *MakeSwapProposal) ValidateBasic() error {
if err := m.ToDenomMetadata.Validate(); err != nil {
return err
}
if m.Swap.ToDenom != m.ToDenomMetadata.Base {
return sdkerrors.ErrInvalidRequest.Wrapf("denomination does not match %s != %s", m.Swap.ToDenom, m.ToDenomMetadata.Base)
}

return gov.ValidateAbstract(m)
}

0 comments on commit 472d5b4

Please sign in to comment.