Skip to content
Snippets Groups Projects
Unverified Commit aaf27e9b authored by Benjamin Bollen's avatar Benjamin Bollen
Browse files

eris-mint: remove lingering genesis/types

parent 3270d0c5
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ var g1 = fmt.Sprintf(`
{
"address": "%X",
"amount": %d,
"name": "%s",
"name": "%s",
"permissions": {
"base": {
"perms": %d,
......
package types
import (
"fmt"
"time"
"github.com/eris-ltd/eris-db/common/sanity"
ptypes "github.com/eris-ltd/eris-db/permission/types"
"github.com/tendermint/go-crypto"
"github.com/tendermint/go-wire"
)
//------------------------------------------------------------
// we store the gendoc in the db
var GenDocKey = []byte("GenDocKey")
//------------------------------------------------------------
// core types for a genesis definition
type BasicAccount struct {
Address []byte `json:"address"`
Amount int64 `json:"amount"`
}
type GenesisAccount struct {
Address []byte `json:"address"`
Amount int64 `json:"amount"`
Name string `json:"name"`
Permissions *ptypes.AccountPermissions `json:"permissions"`
}
type GenesisValidator struct {
PubKey crypto.PubKey `json:"pub_key"`
Amount int64 `json:"amount"`
Name string `json:"name"`
UnbondTo []BasicAccount `json:"unbond_to"`
}
type GenesisParams struct {
GlobalPermissions *ptypes.AccountPermissions `json:"global_permissions"`
}
type GenesisDoc struct {
GenesisTime time.Time `json:"genesis_time"`
ChainID string `json:"chain_id"`
Params *GenesisParams `json:"params"`
Accounts []GenesisAccount `json:"accounts"`
Validators []GenesisValidator `json:"validators"`
}
//------------------------------------------------------------
// Make genesis state from file
func GenesisDocFromJSON(jsonBlob []byte) (genState *GenesisDoc) {
var err error
wire.ReadJSONPtr(&genState, jsonBlob, &err)
if err != nil {
sanity.PanicCrisis(fmt.Sprintf("Couldn't read GenesisDoc: %v", err))
}
return
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment