forked from eoscanada/eos-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regproducer.go
32 lines (29 loc) · 969 Bytes
/
regproducer.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
package system
import (
eos "github.com/Jumper-Bridge/cyberway"
"github.com/Jumper-Bridge/cyberway/ecc"
)
// NewRegProducer returns a `regproducer` action that lives on the
// `eosio.system` contract.
func NewRegProducer(producer eos.AccountName, producerKey ecc.PublicKey, url string, location uint16) *eos.Action {
return &eos.Action{
Account: AN("eosio"),
Name: ActN("regproducer"),
Authorization: []eos.PermissionLevel{
{Actor: producer, Permission: PN("active")},
},
ActionData: eos.NewActionData(RegProducer{
Producer: producer,
ProducerKey: producerKey,
URL: url,
Location: location,
}),
}
}
// RegProducer represents the `eosio.system::regproducer` action
type RegProducer struct {
Producer eos.AccountName `json:"producer"`
ProducerKey ecc.PublicKey `json:"producer_key"`
URL string `json:"url"`
Location uint16 `json:"location"` // what,s the meaning of that anyway ?
}