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