diff --git a/chain/address/constants.go b/chain/address/constants.go index 1da2488c3..8fc66c678 100644 --- a/chain/address/constants.go +++ b/chain/address/constants.go @@ -20,21 +20,6 @@ func init() { if err != nil { panic(err) } - - NetworkAddress, err = NewActorAddress([]byte("filecoin")) - if err != nil { - panic(err) - } - - StorageMarketAddress, err = NewActorAddress([]byte("storage")) - if err != nil { - panic(err) - } - - PaymentBrokerAddress, err = NewActorAddress([]byte("payments")) - if err != nil { - panic(err) - } } var ( @@ -42,13 +27,6 @@ var ( TestAddress Address // TestAddress2 is an account with some initial funds in it. TestAddress2 Address - - // NetworkAddress is the filecoin network. - NetworkAddress Address - // StorageMarketAddress is the hard-coded address of the filecoin storage market. - StorageMarketAddress Address - // PaymentBrokerAddress is the hard-coded address of the filecoin storage market. - PaymentBrokerAddress Address ) var ( diff --git a/chain/vm/mkactor.go b/chain/vm/mkactor.go index 52e8cd7f2..4ce8ff994 100644 --- a/chain/vm/mkactor.go +++ b/chain/vm/mkactor.go @@ -34,7 +34,7 @@ func makeActor(st *state.StateTree, addr address.Address) (*types.Actor, error) case address.ID: return nil, fmt.Errorf("no actor with given ID") case address.Actor: - return nil, fmt.Errorf("no such actor") + return nil, fmt.Errorf("no such actor: %s", addr) default: return nil, fmt.Errorf("address has unsupported protocol: %d", addr.Protocol()) } diff --git a/chain/vm/vm.go b/chain/vm/vm.go index d1d7c3f38..9de1d5a85 100644 --- a/chain/vm/vm.go +++ b/chain/vm/vm.go @@ -252,7 +252,7 @@ func (vm *VM) ApplyMessage(msg *types.Message) (*types.MessageReceipt, error) { // reward miner gas fees miner, err := st.GetActor(vm.blockMiner) if err != nil { - return nil, xerrors.Errorf("getting block miner actor failed: %w", err) + return nil, xerrors.Errorf("getting block miner actor (%s) failed: %w", vm.blockMiner, err) } gasReward := types.BigMul(msg.GasPrice, vmctx.GasUsed()) diff --git a/cli/miner.go b/cli/miner.go index 607f26512..d4ed66b9c 100644 --- a/cli/miner.go +++ b/cli/miner.go @@ -5,8 +5,6 @@ import ( "github.com/pkg/errors" "gopkg.in/urfave/cli.v2" - - "github.com/filecoin-project/go-lotus/chain/address" ) var minerCmd = &cli.Command{ @@ -29,7 +27,7 @@ var minerStart = &cli.Command{ ctx := ReqContext(cctx) // TODO: this address needs to be the address of an actual miner - maddr, err := address.NewIDAddress(523423423) + maddr, err := api.WalletDefaultAddress(ctx) if err != nil { return errors.Wrap(err, "failed to create miner address") } diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 6e00853b2..f3ce44d17 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -8,7 +8,6 @@ import ( "github.com/filecoin-project/go-lotus/build" "github.com/filecoin-project/go-lotus/chain" "github.com/filecoin-project/go-lotus/chain/actors" - "github.com/filecoin-project/go-lotus/chain/address" "github.com/filecoin-project/go-lotus/chain/types" lcli "github.com/filecoin-project/go-lotus/cli" "github.com/filecoin-project/go-lotus/node/repo" @@ -119,7 +118,7 @@ var initCmd = &cli.Command{ } createStorageMinerMsg := types.Message{ - To: address.StorageMarketAddress, + To: actors.StorageMarketAddress, From: defOwner, Nonce: nonce,