/
mlog.go
50 lines (44 loc) · 1.45 KB
/
mlog.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
package state
import "github.com/ellaism/go-ellaism/logger"
var mlogState = logger.MLogRegisterAvailable("state", mlogStateLines)
var mlogStateLines = []logger.MLogT{
mlogStateCreateObject,
mlogStateAddBalanceObject,
mlogStateSubBalanceObject,
}
var mlogStateCreateObject = logger.MLogT{
Description: `Called once when a state object is created.
$OBJECT.NEW is the address of the newly-created object.
If there was an existing account with the same address, it is overwritten and its address returned as the $OBJECT.PREV value.`,
Receiver: "STATE",
Verb: "CREATE",
Subject: "OBJECT",
Details: []logger.MLogDetailT{
{"OBJECT", "NEW", "STRING"},
{"OBJECT", "PREV", "STRING"},
},
}
var mlogStateAddBalanceObject = logger.MLogT{
Description: "Called once when the balance of an account (state object) is added to.",
Receiver: "STATE",
Verb: "ADD_BALANCE",
Subject: "OBJECT",
Details: []logger.MLogDetailT{
{"OBJECT", "ADDRESS", "STRING"},
{"OBJECT", "NONCE", "INT"},
{"OBJECT", "BALANCE", "BIGINT"},
{"ADD_BALANCE", "AMOUNT", "BIGINT"},
},
}
var mlogStateSubBalanceObject = logger.MLogT{
Description: "Called once when the balance of an account (state object) is subtracted from.",
Receiver: "STATE",
Verb: "SUB_BALANCE",
Subject: "OBJECT",
Details: []logger.MLogDetailT{
{"OBJECT", "ADDRESS", "STRING"},
{"OBJECT", "NONCE", "INT"},
{"OBJECT", "BALANCE", "BIGINT"},
{"SUB_BALANCE", "AMOUNT", "BIGINT"},
},
}