-
Notifications
You must be signed in to change notification settings - Fork 39
/
trace.go
83 lines (66 loc) · 1.24 KB
/
trace.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 module
import "math/big"
type TraceRange int
const (
TraceRangeBlock TraceRange = iota
TraceRangeTransaction
TraceRangeBlockTransaction
)
type TraceInfo struct {
TraceMode TraceMode
TraceBlock TraceBlock
Range TraceRange
// Group and Index are valid only if Range is TraceRangeTransaction
Group TransactionGroup
Index int
Callback TraceCallback
}
type TraceBlock interface {
ID() []byte
GetReceipt(txIndex int) Receipt
}
type TraceLevel int
const (
TDebugLevel TraceLevel = iota
TTraceLevel
TSystemLevel
)
type TraceMode int
const (
TraceModeNone TraceMode = iota
TraceModeInvoke
TraceModeBalanceChange
)
type OpType int
const (
Genesis OpType = iota
Transfer
Fee
Issue
Burn
Lost
FSDeposit
FSWithdraw
FSFee
Stake
Unstake
Claim
Ghost
Reward
RegPRep
)
type ExecutionPhase int
const (
EPhaseTransaction ExecutionPhase = iota
EPhaseExecutionEnd
)
type TraceCallback interface {
OnLog(level TraceLevel, msg string)
OnEnd(e error)
OnTransactionStart(txIndex int, txHash []byte, isBlockTx bool) error
OnTransactionReset() error
OnTransactionEnd(txIndex int, txHash []byte) error
OnFrameEnter() error
OnFrameExit(success bool) error
OnBalanceChange(opType OpType, from, to Address, amount *big.Int) error
}