f23f691646
* Add config file for linter * Fix lint errors * Fix gofumpt errors * Fix pre-allocate slices lint error * Remove unused lint rule * Disable style check ID error * Add gomodguard section in yml file * Remove trailing white spaces * Remove unnecessary comments --------- Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
26 lines
608 B
Go
26 lines
608 B
Go
package onboarding
|
|
|
|
import (
|
|
errorsmod "cosmossdk.io/errors"
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
|
)
|
|
|
|
var _ sdk.Msg = &MsgOnboardParticipant{}
|
|
|
|
func (msg MsgOnboardParticipant) ValidateBasic() error {
|
|
if len(msg.Participant) == 0 {
|
|
return errorsmod.Wrap(sdkerrors.ErrorInvalidSigner, msg.Participant)
|
|
}
|
|
|
|
if len(msg.EthPayload.Address) != 42 {
|
|
return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Participant)
|
|
}
|
|
|
|
if len(msg.EthSignature) != 132 {
|
|
return errorsmod.Wrap(sdkerrors.ErrNoSignatures, "Invalid signature.")
|
|
}
|
|
|
|
return nil
|
|
}
|