forked from eoscanada/eos-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setpriv.go
28 lines (25 loc) · 807 Bytes
/
setpriv.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
package system
import eos "github.com/sebastianmontero/eos-go"
// NewSetPriv returns a `setpriv` action that lives on the
// `eosio.bios` contract. It should exist only when booting a new
// network, as it is replaced using the `eos-bios` boot process by the
// `eosio.system` contract.
func NewSetPriv(account eos.AccountName) *eos.Action {
a := &eos.Action{
Account: AN("eosio"),
Name: ActN("setpriv"),
Authorization: []eos.PermissionLevel{
{Actor: AN("eosio"), Permission: PN("active")},
},
ActionData: eos.NewActionData(SetPriv{
Account: account,
IsPriv: eos.Bool(true),
}),
}
return a
}
// SetPriv sets privileged account status. Used in the bios boot mechanism.
type SetPriv struct {
Account eos.AccountName `json:"account"`
IsPriv eos.Bool `json:"is_priv"`
}