-
Notifications
You must be signed in to change notification settings - Fork 17
/
bigmap_action.go
58 lines (52 loc) · 1.14 KB
/
bigmap_action.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
package types
// BigMapAction -
type BigMapAction int
// NewBigMapAction -
func NewBigMapAction(value string) BigMapAction {
switch value {
case BigMapActionStringAlloc:
return BigMapActionAlloc
case BigMapActionStringUpdate:
return BigMapActionUpdate
case BigMapActionStringCopy:
return BigMapActionCopy
case BigMapActionStringRemove:
return BigMapActionRemove
default:
return 0
}
}
// String -
func (action BigMapAction) String() string {
switch action {
case BigMapActionAlloc:
return BigMapActionStringAlloc
case BigMapActionUpdate:
return BigMapActionStringUpdate
case BigMapActionCopy:
return BigMapActionStringCopy
case BigMapActionRemove:
return BigMapActionStringRemove
default:
return ""
}
}
// int values
const (
BigMapActionAlloc BigMapAction = iota + 1
BigMapActionUpdate
BigMapActionCopy
BigMapActionRemove
)
// string values
const (
BigMapActionStringUpdate = "update"
BigMapActionStringCopy = "copy"
BigMapActionStringAlloc = "alloc"
BigMapActionStringRemove = "remove"
)
// lazy storage diff types
const (
LazyStorageDiffBigMap = "big_map"
LazyStorageDiffSaplingState = "sapling_state"
)