setup proper template defaults

This commit is contained in:
whyrusleeping 2020-08-18 14:34:35 -07:00
parent abca69b476
commit 916bebadef
2 changed files with 15 additions and 12 deletions

View File

@ -48,10 +48,11 @@ var genesisNewCmd = &cli.Command{
return xerrors.New("seed genesis new [genesis.json]") return xerrors.New("seed genesis new [genesis.json]")
} }
out := genesis.Template{ out := genesis.Template{
Accounts: []genesis.Actor{}, Accounts: []genesis.Actor{},
Miners: []genesis.Miner{}, Miners: []genesis.Miner{},
VerifregRootKey: gen.DefaultVerifregRootkeyActor, VerifregRootKey: gen.DefaultVerifregRootkeyActor,
NetworkName: cctx.String("network-name"), RemainderAccount: gen.DefaultRemainderAccountActor,
NetworkName: cctx.String("network-name"),
} }
if out.NetworkName == "" { if out.NetworkName == "" {
out.NetworkName = "localnet-" + uuid.New().String() out.NetworkName = "localnet-" + uuid.New().String()

View File

@ -212,10 +212,11 @@ func builder(t *testing.T, nFull int, storage []test.StorageMiner) ([]test.TestN
genms = append(genms, *genm) genms = append(genms, *genm)
} }
templ := &genesis.Template{ templ := &genesis.Template{
Accounts: genaccs, Accounts: genaccs,
Miners: genms, Miners: genms,
Timestamp: uint64(time.Now().Unix() - 10000), // some time sufficiently far in the past Timestamp: uint64(time.Now().Unix() - 10000), // some time sufficiently far in the past
VerifregRootKey: gen.DefaultVerifregRootkeyActor, VerifregRootKey: gen.DefaultVerifregRootkeyActor,
RemainderAccount: gen.DefaultRemainderAccountActor,
} }
// END PRESEAL SECTION // END PRESEAL SECTION
@ -362,10 +363,11 @@ func mockSbBuilder(t *testing.T, nFull int, storage []test.StorageMiner) ([]test
genms = append(genms, *genm) genms = append(genms, *genm)
} }
templ := &genesis.Template{ templ := &genesis.Template{
Accounts: genaccs, Accounts: genaccs,
Miners: genms, Miners: genms,
Timestamp: uint64(time.Now().Unix()) - (build.BlockDelaySecs * 20000), Timestamp: uint64(time.Now().Unix()) - (build.BlockDelaySecs * 20000),
VerifregRootKey: gen.DefaultVerifregRootkeyActor, VerifregRootKey: gen.DefaultVerifregRootkeyActor,
RemainderAccount: gen.DefaultRemainderAccountActor,
} }
// END PRESEAL SECTION // END PRESEAL SECTION