-
Notifications
You must be signed in to change notification settings - Fork 15
/
eosio_contract_types.go
137 lines (109 loc) · 3.36 KB
/
eosio_contract_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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package chain
import (
"github.com/eosspark/eos-go/chain/types"
"github.com/eosspark/eos-go/common"
"github.com/eosspark/eos-go/common/eos_math"
)
type NewAccount struct {
Creator common.AccountName `json:"creator"`
Name common.AccountName `json:"name"`
Owner types.Authority `json:"owner"`
Active types.Authority `json:"active"`
}
func (n *NewAccount) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (n *NewAccount) GetName() common.ActionName {
return common.N("newaccount")
}
type SetCode struct {
Account common.AccountName `json:"account"`
VmType uint8 `json:"vmtype"`
VmVersion uint8 `json:"vmversion"`
Code []byte `json:"code"`
}
func (s *SetCode) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (s *SetCode) GetName() common.ActionName {
return common.N("setcode")
}
type SetAbi struct {
Account common.AccountName `json:"account"`
Abi []byte `json:"abi"`
}
func (s SetAbi) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (s SetAbi) GetName() common.ActionName {
return common.N("setabi")
}
type UpdateAuth struct {
Account common.AccountName `json:"account"`
Permission common.PermissionName `json:"permission"`
Parent common.PermissionName `json:"parent"`
Auth types.Authority `json:"auth"`
}
func (u UpdateAuth) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (u UpdateAuth) GetName() common.ActionName {
return common.N("updateauth")
}
type DeleteAuth struct {
Account common.AccountName `json:""`
Permission common.PermissionName `json:""`
}
func (d DeleteAuth) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (d DeleteAuth) GetName() common.ActionName {
return common.N("deleteauth")
}
type LinkAuth struct {
Account common.AccountName `json:"account"`
Code common.AccountName `json:"code"`
Type common.ActionName `json:"type"`
Requirement common.PermissionName `json:"requirement"`
}
func (l LinkAuth) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (l LinkAuth) GetName() common.ActionName {
return common.N("linkauth")
}
type UnLinkAuth struct {
Account common.AccountName `json:"account"`
Code common.AccountName `json:"code"`
Type common.ActionName `json:"type"`
}
func (u UnLinkAuth) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (u UnLinkAuth) GetName() common.ActionName {
return common.N("unlinkauth")
}
type CancelDelay struct {
CancelingAuth common.PermissionLevel `json:""`
TrxId common.TransactionIdType `json:""`
}
func (c CancelDelay) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (c CancelDelay) GetName() common.ActionName {
return common.N("canceldelay")
}
type OnError struct {
SenderId eos_math.Uint128 `json:"sender_id"`
SentTrx []byte `json:"sent_trx"`
}
func NewOnError(sid eos_math.Uint128, data []byte) *OnError {
oe := OnError{SenderId: sid, SentTrx: data}
return &oe
}
func (o OnError) GetAccount() common.AccountName {
return common.DefaultConfig.SystemAccountName
}
func (o OnError) GetName() common.ActionName {
return common.N("onerror")
}