forked from oracleNetworkProtocol/plugchain-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tx_config.go
35 lines (29 loc) · 1013 Bytes
/
tx_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
package types
import signingtypes "plugchain-sdk-go/types/tx/signing"
type (
TxConfig interface {
TxEncodingConfig
NewTxBuilder() TxBuilder
WrapTxBuilder(Tx) (TxBuilder, error)
SignModeHandler() SignModeHandler
}
//Tx Builder The interface type that defines a specific transaction defined by an application must be implemented: it must be able to set messages, generate signatures, and provide specification bytes for signature
TxBuilder interface {
GetTx() Tx
SetMsgs(msgs ...Msg) error
SetSignatures(signatures ...signingtypes.SignatureV2) error
SetMemo(memo string)
SetFeeAmount(amount Coins)
SetGasLimit(limit uint64)
SetTimeoutHeight(height uint64)
}
//Encoders and decoders containing transactions
TxEncodingConfig interface {
TxEncoder() TxEncoder
TxDecoder() TxDecoder
TxJSONEncoder() TxEncoder
TxJSONDecoder() TxDecoder
MarshalSignatureJSON([]signingtypes.SignatureV2) ([]byte, error)
UnmarshalSignatureJSON([]byte) ([]signingtypes.SignatureV2, error)
}
)