forked from oracleNetworkProtocol/plugchain-sdk-go
/
tx_msg.go
67 lines (54 loc) · 1.05 KB
/
tx_msg.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
package types
import (
"github.com/gogo/protobuf/proto"
"github.com/tendermint/tendermint/crypto"
)
type (
//The interface that the transaction message must satisfy
Msg interface {
proto.Message
//Return message type
Route() string
//Return message string
Type() string
//Validation before query
ValidateBasic() error
//Get message - bytes
GetSignBytes() []byte
GetSigners() []AccAddress
}
//Return fee
Fee interface {
GetGas() uint64
GetAmount() Coins
}
//autograph
Signature interface {
GetPubKey() crypto.PubKey
GetSignature() []byte
}
//Interface that the transaction must complete
Tx interface {
// Get all transactions
GetMsgs() []Msg
//Validation before query
ValidateBasic() error
}
FeeTx interface {
Tx
GetGas() uint64
GetFee() Coins
FeePayer() AccAddress
FeeGranter() AccAddress
}
TxWithMemo interface {
Tx
GetMemo() string
}
TxWithTimeoutHeight interface {
Tx
GetTimeoutHeight() uint64
}
)
type TxEncoder func(tx Tx) ([]byte, error)
type TxDecoder func(txBytes []byte) (Tx, error)