Skip to content

Commit

Permalink
refactor: use coin.Validate()
Browse files Browse the repository at this point in the history
  • Loading branch information
Unique-Divine committed Mar 19, 2024
1 parent 2e99e3f commit d91a509
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions x/inflation/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,13 @@ func (m MsgBurn) ValidateBasic() error {
return err
}

if m.Coin.Denom == "" {
return fmt.Errorf("coin denom should not be empty")
if err := m.Coin.Validate(); err != nil {
return err
}

if m.Coin.Amount.IsZero() {
return fmt.Errorf("coin amount should not be zero")
}

if m.Coin.IsNil() {
return fmt.Errorf("coin should not be nil")
}

return nil
}

0 comments on commit d91a509

Please sign in to comment.