From b2d425b891a459abf9a7e74db01738e2c98c4ec9 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Fri, 16 Aug 2019 12:39:09 -0700 Subject: [PATCH] TEMP: accept miner address from cli --- chain/vm/call.go | 1 + cli/miner.go | 5 +++-- node/modules/testing/genesis.go | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/chain/vm/call.go b/chain/vm/call.go index d85f34145..8f3b04d1e 100644 --- a/chain/vm/call.go +++ b/chain/vm/call.go @@ -56,6 +56,7 @@ func Call(ctx context.Context, cs *store.ChainStore, msg *types.Message, ts *typ if ts == nil { ts = cs.GetHeaviestTipSet() } + state, err := cs.TipSetState(ts.Cids()) if err != nil { return nil, err diff --git a/cli/miner.go b/cli/miner.go index 0ca63fd5c..2a89de9a5 100644 --- a/cli/miner.go +++ b/cli/miner.go @@ -3,6 +3,7 @@ package cli import ( "fmt" + "github.com/filecoin-project/go-lotus/chain/address" "gopkg.in/urfave/cli.v2" ) @@ -25,8 +26,8 @@ var minerStart = &cli.Command{ ctx := ReqContext(cctx) - // TODO: this address needs to be the address of an actual miner - maddr, err := api.WalletDefaultAddress(ctx) + // TODO: need to pull this from disk or something + maddr, err := address.NewFromString(cctx.Args().First()) if err != nil { return err } diff --git a/node/modules/testing/genesis.go b/node/modules/testing/genesis.go index 79c52eb1b..6951282ed 100644 --- a/node/modules/testing/genesis.go +++ b/node/modules/testing/genesis.go @@ -2,6 +2,7 @@ package testing import ( "context" + "fmt" "io" "os" @@ -80,6 +81,8 @@ func MakeGenesis(outFile string) func(bs dtypes.ChainBlockstore, w *wallet.Walle return nil, err } + fmt.Println("GENESIS MINER ADDRESS: ", gmc.MinerAddr.String()) + f, err := os.OpenFile(outFile, os.O_CREATE|os.O_WRONLY, 0644) if err != nil { return nil, err