mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
legacy msg support for earn msgs (#1296)
This commit is contained in:
parent
0c7e357f10
commit
fe89ba938d
@ -3,11 +3,20 @@ package types
|
|||||||
import (
|
import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
|
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
_ sdk.Msg = &MsgDeposit{}
|
_ sdk.Msg = &MsgDeposit{}
|
||||||
_ sdk.Msg = &MsgWithdraw{}
|
_ sdk.Msg = &MsgWithdraw{}
|
||||||
|
_ legacytx.LegacyMsg = &MsgDeposit{}
|
||||||
|
_ legacytx.LegacyMsg = &MsgWithdraw{}
|
||||||
|
)
|
||||||
|
|
||||||
|
// legacy message types
|
||||||
|
const (
|
||||||
|
TypeMsgDeposit = "earn_msg_deposit"
|
||||||
|
TypeMsgWithdraw = "earn_msg_withdraw"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewMsgDeposit returns a new MsgDeposit.
|
// NewMsgDeposit returns a new MsgDeposit.
|
||||||
@ -47,6 +56,16 @@ func (msg MsgDeposit) GetSigners() []sdk.AccAddress {
|
|||||||
return []sdk.AccAddress{depositor}
|
return []sdk.AccAddress{depositor}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Route implements the LegacyMsg.Route method.
|
||||||
|
func (msg MsgDeposit) Route() string {
|
||||||
|
return RouterKey
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type implements the LegacyMsg.Type method.
|
||||||
|
func (msg MsgDeposit) Type() string {
|
||||||
|
return TypeMsgDeposit
|
||||||
|
}
|
||||||
|
|
||||||
// NewMsgWithdraw returns a new MsgWithdraw.
|
// NewMsgWithdraw returns a new MsgWithdraw.
|
||||||
func NewMsgWithdraw(from string, amount sdk.Coin) *MsgWithdraw {
|
func NewMsgWithdraw(from string, amount sdk.Coin) *MsgWithdraw {
|
||||||
return &MsgWithdraw{
|
return &MsgWithdraw{
|
||||||
@ -83,3 +102,13 @@ func (msg MsgWithdraw) GetSigners() []sdk.AccAddress {
|
|||||||
|
|
||||||
return []sdk.AccAddress{depositor}
|
return []sdk.AccAddress{depositor}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Route implements the LegacyMsg.Route method.
|
||||||
|
func (msg MsgWithdraw) Route() string {
|
||||||
|
return RouterKey
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type implements the LegacyMsg.Type method.
|
||||||
|
func (msg MsgWithdraw) Type() string {
|
||||||
|
return TypeMsgWithdraw
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user