Skip to content

Commit

Permalink
chore: extract const
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Jan 29, 2025
1 parent c9e4493 commit 9449df7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions x/migration/types/message_claim_morse_pokt.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

var _ sdk.Msg = &MsgClaimMorsePokt{}
const morseAddressByteLength = 20

var _ sdk.Msg = (*MsgClaimMorsePokt)(nil)

func NewMsgClaimMorsePokt(shannonDestAddress string, morseSrcAddress string, morseSignature []byte) *MsgClaimMorsePokt {
return &MsgClaimMorsePokt{
Expand All @@ -29,7 +31,7 @@ func (msg *MsgClaimMorsePokt) ValidateBasic() error {
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid morseSrcAddress address (%s)", err)
}

if len(morseAddrBz) != 20 {
if len(morseAddrBz) != morseAddressByteLength {
return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid morseSrcAddress address (%s)", err)
}

Expand Down

0 comments on commit 9449df7

Please sign in to comment.