Skip to content

Commit

Permalink
add msg impls, add codec, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed Jul 12, 2023
1 parent b3bc39d commit 6cee983
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/msgfees/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgAssessCustomMsgFeeRequest{},
&MsgAddMsgFeeProposalRequest{},
&MsgUpdateMsgFeeProposalRequest{},
&MsgRemoveMsgFeeProposalRequest{},
&MsgUpdateNhashPerUsdMilProposalRequest{},
&MsgUpdateConversionFeeDenomProposalRequest{},
)
}

Expand Down
182 changes: 182 additions & 0 deletions x/msgfees/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const (
// Compile time interface checks.
var (
_ sdk.Msg = &MsgAssessCustomMsgFeeRequest{}
_ sdk.Msg = &MsgAddMsgFeeProposalRequest{}

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 23 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgAddMsgFeeProposalRequest
_ sdk.Msg = &MsgUpdateMsgFeeProposalRequest{}

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 24 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgUpdateMsgFeeProposalRequest
_ sdk.Msg = &MsgRemoveMsgFeeProposalRequest{}

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgRemoveMsgFeeProposalRequest

Check failure on line 25 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgRemoveMsgFeeProposalRequest
_ sdk.Msg = &MsgUpdateConversionFeeDenomProposalRequest{}

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgUpdateConversionFeeDenomProposalRequest

Check failure on line 26 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgUpdateConversionFeeDenomProposalRequest
_ sdk.Msg = &MsgUpdateNhashPerUsdMilProposalRequest{}

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgUpdateNhashPerUsdMilProposalRequest

Check failure on line 27 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgUpdateNhashPerUsdMilProposalRequest
)

func NewMsgAssessCustomMsgFeeRequest(
Expand Down Expand Up @@ -80,3 +85,180 @@ func (msg MsgAssessCustomMsgFeeRequest) GetSigners() []sdk.AccAddress {
}
return []sdk.AccAddress{addr}
}

func NewMsgAddMsgFeeProposalRequest(msgTypeURL string, additionalFee sdk.Coin, recipient string, recipientBasisPoints string, authority string) *MsgAddMsgFeeProposalRequest {

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 89 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgAddMsgFeeProposalRequest
return &MsgAddMsgFeeProposalRequest{
MsgTypeUrl: msgTypeURL,
AdditionalFee: additionalFee,
Recipient: recipient,
RecipientBasisPoints: recipientBasisPoints,
Authority: authority,
}
}

func (msg *MsgAddMsgFeeProposalRequest) ValidateBasic() error {

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 99 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgAddMsgFeeProposalRequest
if len(msg.MsgTypeUrl) == 0 {
return ErrEmptyMsgType
}

if !msg.AdditionalFee.IsPositive() {
return ErrInvalidFee
}

if err := msg.AdditionalFee.Validate(); err != nil {
return err
}

if len(msg.Recipient) != 0 {
_, err := sdk.AccAddressFromBech32(msg.Recipient)
if err != nil {
return err
}
}

if len(msg.RecipientBasisPoints) > 0 && len(msg.Recipient) > 0 {
bips, err := strconv.ParseUint(msg.RecipientBasisPoints, 0, 64)
if err != nil {
return err
}
if bips > 10_000 {
return fmt.Errorf("recipient basis points can only be between 0 and 10,000 : %v", msg.RecipientBasisPoints)
}
} else if len(msg.RecipientBasisPoints) > 0 && len(msg.Recipient) == 0 {
return fmt.Errorf("")
}

_, err := sdk.AccAddressFromBech32(msg.Authority)
if err != nil {
return err
}

return nil
}

func (msg *MsgAddMsgFeeProposalRequest) GetSigners() []sdk.AccAddress {

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgAddMsgFeeProposalRequest

Check failure on line 139 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgAddMsgFeeProposalRequest
addr := sdk.MustAccAddressFromBech32(msg.Authority)
return []sdk.AccAddress{addr}
}

func NewMsgUpdateMsgFeeProposalRequest(msgTypeURL string, additionalFee sdk.Coin, recipient string, recipientBasisPoints string, authority string) *MsgUpdateMsgFeeProposalRequest {

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 144 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgUpdateMsgFeeProposalRequest
return &MsgUpdateMsgFeeProposalRequest{
MsgTypeUrl: msgTypeURL,
AdditionalFee: additionalFee,
Recipient: recipient,
RecipientBasisPoints: recipientBasisPoints,
Authority: authority,
}
}

func (msg *MsgUpdateMsgFeeProposalRequest) ValidateBasic() error {

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / build-linux

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / rosetta

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build dbmigrate

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (03)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (02)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (00)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / test-race (01)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build Linux

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: MsgUpdateMsgFeeProposalRequest

Check failure on line 154 in x/msgfees/types/msgs.go

View workflow job for this annotation

GitHub Actions / Build OSX

undefined: MsgUpdateMsgFeeProposalRequest
if len(msg.MsgTypeUrl) == 0 {
return ErrEmptyMsgType
}

if !msg.AdditionalFee.IsPositive() {
return ErrInvalidFee
}

if len(msg.Recipient) != 0 {
_, err := sdk.AccAddressFromBech32(msg.Recipient)
if err != nil {
return err
}
}
if len(msg.RecipientBasisPoints) > 0 {
bips, err := strconv.ParseUint(msg.RecipientBasisPoints, 0, 64)
if err != nil {
return err
}
if bips > 10_000 {
return fmt.Errorf("recipient basis points can only be between 0 and 10,000 : %v", msg.RecipientBasisPoints)
}
}
_, err := sdk.AccAddressFromBech32(msg.Authority)
if err != nil {
return err
}

return nil
}

func (msg *MsgUpdateMsgFeeProposalRequest) GetSigners() []sdk.AccAddress {
addr := sdk.MustAccAddressFromBech32(msg.Authority)
return []sdk.AccAddress{addr}
}

func NewMsgRemoveMsgFeeProposalRequest(msgTypeURL string, authority string) *MsgRemoveMsgFeeProposalRequest {
return &MsgRemoveMsgFeeProposalRequest{
MsgTypeUrl: msgTypeURL,
Authority: authority,
}
}

func (msg *MsgRemoveMsgFeeProposalRequest) ValidateBasic() error {
if len(msg.MsgTypeUrl) == 0 {
return ErrEmptyMsgType
}

_, err := sdk.AccAddressFromBech32(msg.Authority)
if err != nil {
return err
}

return nil
}

func (msg *MsgRemoveMsgFeeProposalRequest) GetSigners() []sdk.AccAddress {
addr := sdk.MustAccAddressFromBech32(msg.Authority)
return []sdk.AccAddress{addr}
}

func NewMsgUpdateNhashPerUsdMilProposalRequest(nhashPerUsdMil uint64, authority string) *MsgUpdateNhashPerUsdMilProposalRequest {
return &MsgUpdateNhashPerUsdMilProposalRequest{
NhashPerUsdMil: nhashPerUsdMil,
Authority: authority,
}
}

func (msg *MsgUpdateConversionFeeDenomProposalRequest) ValidateBasic() error {
if err := sdk.ValidateDenom(msg.ConversionFeeDenom); err != nil {
return err
}

_, err := sdk.AccAddressFromBech32(msg.Authority)
if err != nil {
return err
}

return nil
}

func (msg *MsgUpdateConversionFeeDenomProposalRequest) GetSigners() []sdk.AccAddress {
addr := sdk.MustAccAddressFromBech32(msg.Authority)
return []sdk.AccAddress{addr}
}

func NewMsgUpdateConversionFeeDenomProposalRequest(conversionFeeDenom string, authority string) *MsgUpdateConversionFeeDenomProposalRequest {
return &MsgUpdateConversionFeeDenomProposalRequest{
ConversionFeeDenom: conversionFeeDenom,
Authority: authority,
}
}

func (msg *MsgUpdateNhashPerUsdMilProposalRequest) ValidateBasic() error {
if msg.NhashPerUsdMil < 1 {
return errors.New("nhash per usd mil must be greater than 0")
}

_, err := sdk.AccAddressFromBech32(msg.Authority)
if err != nil {
return err
}

return nil
}

func (msg *MsgUpdateNhashPerUsdMilProposalRequest) GetSigners() []sdk.AccAddress {
addr := sdk.MustAccAddressFromBech32(msg.Authority)
return []sdk.AccAddress{addr}
}
Loading

0 comments on commit 6cee983

Please sign in to comment.