-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
stdsignmsg.go
36 lines (30 loc) · 1.12 KB
/
stdsignmsg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package legacytx
import (
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
var _ types.UnpackInterfacesMessage = StdSignMsg{}
// StdSignMsg is a convenience structure for passing along a Msg with the other
// requirements for a StdSignDoc before it is signed. For use in the CLI.
type StdSignMsg struct {
ChainID string `json:"chain_id" yaml:"chain_id"`
AccountNumber uint64 `json:"account_number" yaml:"account_number"`
Sequence uint64 `json:"sequence" yaml:"sequence"`
TimeoutHeight uint64 `json:"timeout_height" yaml:"timeout_height"`
Fee StdFee `json:"fee" yaml:"fee"`
Msgs []sdk.Msg `json:"msgs" yaml:"msgs"`
Memo string `json:"memo" yaml:"memo"`
}
// get message bytes
func (msg StdSignMsg) Bytes() []byte {
return StdSignBytes(msg.ChainID, msg.AccountNumber, msg.Sequence, msg.TimeoutHeight, msg.Fee, msg.Msgs, msg.Memo)
}
func (msg StdSignMsg) UnpackInterfaces(unpacker types.AnyUnpacker) error {
for _, m := range msg.Msgs {
err := types.UnpackInterfaces(m, unpacker)
if err != nil {
return err
}
}
return nil
}