forked from eoscanada/eos-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setalimits.go
31 lines (28 loc) · 869 Bytes
/
setalimits.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
package system
import (
eos "github.com/eoscochain/eos-go"
)
// NewSetalimits sets the account limits. Requires signature from `eosio@active` account.
func NewSetalimits(account eos.AccountName, ramBytes, netWeight, cpuWeight int64) *eos.Action {
a := &eos.Action{
Account: AN("eosio"),
Name: ActN("setalimit"),
Authorization: []eos.PermissionLevel{
{Actor: eos.AccountName("eosio"), Permission: PN("active")},
},
ActionData: eos.NewActionData(Setalimits{
Account: account,
RAMBytes: ramBytes,
NetWeight: netWeight,
CPUWeight: cpuWeight,
}),
}
return a
}
// Setalimits represents the `eosio.system::setalimit` action.
type Setalimits struct {
Account eos.AccountName `json:"account"`
RAMBytes int64 `json:"ram_bytes"`
NetWeight int64 `json:"net_weight"`
CPUWeight int64 `json:"cpu_weight"`
}