forked from eoscanada/eos-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateauth.go
71 lines (62 loc) · 1.28 KB
/
updateauth.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
package system
import "github.com/eoscanada/eos-go"
// NewUpdateAuth creates an action from the `eosio.system` contract
// called `updateauth`.
//
// usingPermission needs to be `owner` if you want to modify the
// `owner` authorization, otherwise `active` will do for the rest.
func NewUpdateAuth(account eos.AccountName, permission, parent eos.PermissionName, authority eos.Authority, usingPermission eos.PermissionName) *eos.Action {
a := &eos.Action{
Account: AN("eosio"),
Name: ActN("updateauth"),
Authorization: []eos.PermissionLevel{
{account, usingPermission},
},
ActionData: eos.NewActionData(UpdateAuth{
Account: account,
Permission: permission,
Parent: parent,
Data: authority,
}),
}
return a
}
/**
42a3be5a00000100e543ae35
0000
0000
00
02
ACTION 1
0000000000ea3055 eosio
0040cbdaa86c52d5 updateauth
01
0000000000ea3055 eosio
00000000a8ed3232 active
1e len
0000000000ea3055 eosio
00000000a8ed3232 active
0000000080ab26a7 owner
00000000 threshold
00
00
ACTION 2
0000000000ea3055 eosio
0040cbdaa86c52d5 updateauth
01
0000000000ea3055
00000000a8ed3232
1e len
0000000000ea3055 eosio
0000000080ab26a7 owner
0000000000000000 NONE (parent empty)
00000000
00
00
0000000000ea3055 eosio
00000000a8ed3232 active
0000000080ab26a7 owner
00000000
00
00
*/