forked from bnb-chain/go-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stdtx.go
45 lines (37 loc) · 1.01 KB
/
stdtx.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
package tx
import (
"github.com/cbarraford/go-sdk/types/msg"
"github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/common"
)
const Source int64 = 0
type Tx interface {
// Gets the Msg.
GetMsgs() []msg.Msg
}
// StdTx def
type StdTx struct {
Msgs []msg.Msg `json:"msg"`
Signatures []StdSignature `json:"signatures"`
Memo string `json:"memo"`
Source int64 `json:"source"`
Data []byte `json:"data"`
}
// NewStdTx to instantiate an instance
func NewStdTx(msgs []msg.Msg, sigs []StdSignature, memo string, source int64, data []byte) StdTx {
return StdTx{
Msgs: msgs,
Signatures: sigs,
Memo: memo,
Source: source,
Data: data,
}
}
// GetMsgs def
func (tx StdTx) GetMsgs() []msg.Msg { return tx.Msgs }
type Info struct {
Hash common.HexBytes `json:"hash"`
Height int64 `json:"height"`
Tx Tx `json:"tx"`
Result types.ResponseDeliverTx `json:"result"`
}