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