Skip to content

Commit

Permalink
Added init system func
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeless committed Jul 23, 2020
1 parent 15b8a30 commit 1d323b9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions system/initsystem.go
@@ -0,0 +1,30 @@
package system

import (
eos "github.com/eoscanada/eos-go"
)

// NewInitSystem returns a `init` action that lives on the
// `eosio.system` contract.
func NewInitSystem(version eos.Varuint32, core eos.Symbol) *eos.Action {
return &eos.Action{
Account: AN("eosio"),
Name: ActN("regproducer"),
Authorization: []eos.PermissionLevel{
{
Actor: AN("eosio"),
Permission: eos.PermissionName("active"),
},
},
ActionData: eos.NewActionData(Init{
Version: version,
Core: core,
}),
}
}

// Init represents the `eosio.system::init` action
type Init struct {
Version eos.Varuint32 `json:"version"`
Core eos.Symbol `json:"core"`
}

0 comments on commit 1d323b9

Please sign in to comment.