Skip to content

Commit

Permalink
feat: adding Route, Type, GetSignBytes for all messages
Browse files Browse the repository at this point in the history
  • Loading branch information
seantking committed Jan 17, 2022
1 parent f3e9f95 commit f61ad7d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions modules/apps/29-fee/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
// msg types
const (
TypeMsgRegisterCounterpartyAddress = "registerCounterpartyAddress"
TypeMsgPayPacketFee = "payPacketFee"
TypeMsgPayPacketFeeAsync = "payPacketFeeAsync"
)

// NewMsgRegisterCounterpartyAddress creates a new instance of MsgRegisterCounterpartyAddress
Expand Down Expand Up @@ -44,6 +46,21 @@ func (msg MsgRegisterCounterpartyAddress) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{signer}
}

// Route implements sdk.Msg
func (msg MsgRegisterCounterpartyAddress) Route() string {
return RouterKey
}

// Type implements sdk.Msg
func (msg MsgRegisterCounterpartyAddress) Type() string {
return TypeMsgRegisterCounterpartyAddress
}

// GetSignBytes implements sdk.Msg.
func (msg MsgRegisterCounterpartyAddress) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
}

// NewMsgPayPacketFee creates a new instance of MsgPayPacketFee
func NewMsgPayPacketFee(fee Fee, sourcePortId, sourceChannelId, signer string, relayers []string) *MsgPayPacketFee {
return &MsgPayPacketFee{
Expand Down Expand Up @@ -102,6 +119,21 @@ func (msg MsgPayPacketFee) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{signer}
}

// Route implements sdk.Msg
func (msg MsgPayPacketFee) Route() string {
return RouterKey
}

// Type implements sdk.Msg
func (msg MsgPayPacketFee) Type() string {
return TypeMsgPayPacketFee
}

// GetSignBytes implements sdk.Msg.
func (msg MsgPayPacketFee) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
}

// NewMsgPayPacketAsync creates a new instance of MsgPayPacketFee
func NewMsgPayPacketFeeAsync(identifiedPacketFee IdentifiedPacketFee) *MsgPayPacketFeeAsync {
return &MsgPayPacketFeeAsync{
Expand Down Expand Up @@ -135,6 +167,21 @@ func (msg MsgPayPacketFeeAsync) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{signer}
}

// Route implements sdk.Msg
func (msg MsgPayPacketFeeAsync) Route() string {
return RouterKey
}

// Type implements sdk.Msg
func (msg MsgPayPacketFeeAsync) Type() string {
return TypeMsgPayPacketFeeAsync
}

// GetSignBytes implements sdk.Msg.
func (msg MsgPayPacketFeeAsync) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
}

func NewIdentifiedPacketFee(packetId *channeltypes.PacketId, fee Fee, refundAddr string, relayers []string) *IdentifiedPacketFee {
return &IdentifiedPacketFee{
PacketId: packetId,
Expand Down

0 comments on commit f61ad7d

Please sign in to comment.