github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/x/auth/ibcsigning/sign_mode_handler.go (about) 1 package signing 2 3 import ( 4 ibctx "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types/ibc-adapter" 5 "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types/tx/signing" 6 ) 7 8 // SignModeHandler defines a interface to be implemented by types which will handle 9 // SignMode's by generating sign bytes from a Tx and SignerData 10 type SignModeHandler interface { 11 // DefaultMode is the default mode that is to be used with this handler if no 12 // other mode is specified. This can be useful for testing and CLI usage 13 DefaultMode() signing.SignMode 14 15 // Modes is the list of modes supporting by this handler 16 Modes() []signing.SignMode 17 18 // GetSignBytes returns the sign bytes for the provided SignMode, SignerData and Tx, 19 // or an error 20 GetSignBytes(mode signing.SignMode, data SignerData, tx ibctx.Tx) ([]byte, error) 21 } 22 23 // SignerData is the specific information needed to sign a transaction that generally 24 // isn't included in the transaction body itself 25 type SignerData struct { 26 // ChainID is the chain that this transaction is targeted 27 ChainID string 28 29 // AccountNumber is the account number of the signer 30 AccountNumber uint64 31 32 // Sequence is the account sequence number of the signer that is used 33 // for replay protection. This field is only useful for Legacy Amino signing, 34 // since in SIGN_MODE_DIRECT the account sequence is already in the signer 35 // info. 36 Sequence uint64 37 }