-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathconfig.go
83 lines (72 loc) · 2.07 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package tx
import (
apitxsigning "cosmossdk.io/api/cosmos/tx/signing/v1beta1"
"cosmossdk.io/client/v2/internal/tx"
"cosmossdk.io/client/v2/offchain"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
)
// TxConfig defines an interface a client can utilize to generate an
// application-defined concrete transaction type. The type returned must
// implement TxBuilder.
type TxConfig interface {
TxEncodingConfig
TxSigningConfig
TxBuilderProvider
}
// TxEncodingConfig defines an interface that contains transaction
// encoders and decoders
type TxEncodingConfig interface {
TxEncoder() sdk.TxApiEncoder
TxDecoder() sdk.TxApiDecoder
TxJSONEncoder() sdk.TxApiEncoder
TxJSONDecoder() sdk.TxApiDecoder
}
type TxSigningConfig interface {
SignModeHandler() *offchain.HandlerMap
SigningContext() *offchain.SignContext
MarshalSignatureJSON([]signingtypes.SignatureV2) ([]byte, error)
UnmarshalSignatureJSON([]byte) ([]signingtypes.SignatureV2, error)
}
type TxParameters struct {
timeoutHeight uint64
chainID string
memo string
signMode apitxsigning.SignMode
AccountConfig
GasConfig
FeeConfig
ExecutionOptions
ExtensionOptions
}
// AccountConfig defines the 'account' related fields in a transaction.
type AccountConfig struct {
accountNumber uint64
sequence uint64
fromName string
fromAddress sdk.AccAddress
}
// GasConfig defines the 'gas' related fields in a transaction.
type GasConfig struct {
gas uint64
gasAdjustment float64
gasPrices sdk.DecCoins
}
// FeeConfig defines the 'fee' related fields in a transaction.
type FeeConfig struct {
fees sdk.Coins
feeGranter sdk.AccAddress
feePayer sdk.AccAddress
}
// ExecutionOptions defines the transaction execution options ran by the client
type ExecutionOptions struct {
unordered bool
offline bool
generateOnly bool
simulateAndExecute bool
preprocessTxHook tx.PreprocessTxFn
}
type ExtensionOptions struct {
ExtOptions []*codectypes.Any
}