-
Notifications
You must be signed in to change notification settings - Fork 0
/
ibctx_config.go
49 lines (42 loc) · 1.6 KB
/
ibctx_config.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
37
38
39
40
41
42
43
44
45
46
47
48
49
package client
import (
sdk "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/types"
ibcmsg "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/types/ibc-adapter"
"github.com/furyaxyz/fuxchain/libs/cosmos-sdk/types/tx/signing"
signingtypes "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/auth/ibcsigning"
)
type (
// TxEncodingConfig defines an interface that contains transaction
// encoders and decoders
TxEncodingConfig interface {
TxEncoder() ibcmsg.IBCTxEncoder
TxDecoder() ibcmsg.IbcTxDecoder
TxJSONEncoder() ibcmsg.IBCTxEncoder
//TxJSONDecoder() sdk.TxDecoder
MarshalSignatureJSON([]signing.SignatureV2) ([]byte, error)
UnmarshalSignatureJSON([]byte) ([]signing.SignatureV2, error)
}
// TxConfig defines an interface a client can utilize to generate an
// application-defined concrete transaction type. The type returned must
// implement TxBuilder.
TxConfig interface {
TxEncodingConfig
NewTxBuilder() TxBuilder
WrapTxBuilder(tx ibcmsg.Tx) (TxBuilder, error)
SignModeHandler() signingtypes.SignModeHandler
}
// TxBuilder defines an interface which an application-defined concrete transaction
// type must implement. Namely, it must be able to set messages, generate
// signatures, and provide canonical bytes to sign over. The transaction must
// also know how to encode itself.
TxBuilder interface {
GetTx() signingtypes.Tx
SetMsgs(msgs ...ibcmsg.Msg) error
SetSignatures(signatures ...signing.SignatureV2) error
SetMemo(memo string)
SetFeeAmount(amount sdk.CoinAdapters)
SetGasLimit(limit uint64)
SetTimeoutHeight(height uint64)
SetFeeGranter(feeGranter sdk.AccAddress)
}
)