forked from myxtype/filecoin-client
/
types.go
117 lines (96 loc) · 2.14 KB
/
types.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
package types
import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
"github.com/shopspring/decimal"
"time"
)
type TipSetKey []cid.Cid
type Version struct {
Version string
APIVersion uint32
BlockDelay uint64
}
type BeaconEntry struct {
Round uint64
Data []byte
}
type IpldObject struct {
Cid cid.Cid
Obj interface{}
}
type HeadChange struct {
Type string
Val *TipSet
}
type ObjStat struct {
Size uint64
Links uint64
}
type MessageSendSpec struct {
MaxFee abi.TokenAmount `json:"MaxFee"`
}
type BlockMessages struct {
BlsMessages []*Message `json:"BlsMessages"`
SecpkMessages []*SignedMessage `json:"SecpkMessages"`
Cids []cid.Cid `json:"Cids"`
}
type Actor struct {
Code cid.Cid `json:"Code"`
Head cid.Cid `json:"Head"`
Nonce uint64 `json:"Nonce"`
Balance decimal.Decimal `json:"Balance"`
}
type Ticket struct {
VRFProof []byte
}
type TipSet struct {
Cids []cid.Cid
Blocks []*BlockHeader
Height int64
}
type MessageReceipt struct {
// Ok = ExitCode(0)
ExitCode int64 // 状态为0表示成功
Return []byte
GasUsed int64
}
type Loc struct {
File string
Line int
Function string
}
type GasTrace struct {
Name string
Location []Loc `json:"loc"`
TotalGas int64 `json:"tg"`
ComputeGas int64 `json:"cg"`
StorageGas int64 `json:"sg"`
TotalVirtualGas int64 `json:"vtg"`
VirtualComputeGas int64 `json:"vcg"`
VirtualStorageGas int64 `json:"vsg"`
TimeTaken time.Duration `json:"tt"`
Extra interface{} `json:"ex,omitempty"`
}
type ExecutionTrace struct {
Msg *Message
MsgRct *MessageReceipt
Error string
Duration time.Duration
GasCharges []*GasTrace
Subcalls []ExecutionTrace
}
type InvocResult struct {
Msg *Message
MsgRct *MessageReceipt
ExecutionTrace ExecutionTrace
Error string
Duration time.Duration
}
type MsgLookup struct {
Message cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed
Receipt MessageReceipt
ReturnDec interface{}
TipSet TipSetKey
Height int64
}