From 9449df7feb6f9cced0c609111b21457f9de97d99 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 29 Jan 2025 17:02:38 +0100 Subject: [PATCH] chore: extract const --- x/migration/types/message_claim_morse_pokt.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/migration/types/message_claim_morse_pokt.go b/x/migration/types/message_claim_morse_pokt.go index a270a7cf7..dbf190ffc 100644 --- a/x/migration/types/message_claim_morse_pokt.go +++ b/x/migration/types/message_claim_morse_pokt.go @@ -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{ @@ -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) }