From fb3f7105238ff59ff91fed05aec4eee5ae391dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 14 Sep 2020 15:17:00 +0200 Subject: [PATCH] Some post-master merge fixes --- api/apistruct/struct.go | 8 +++----- chain/gen/genesis/miners.go | 7 +------ chain/gen/genesis/util.go | 13 ++++++++++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index 151e7d99a..1eac858a0 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -2,13 +2,9 @@ package apistruct import ( "context" - "github.com/filecoin-project/go-state-types/dline" - miner2 "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "io" "time" - "github.com/filecoin-project/go-state-types/dline" - "github.com/ipfs/go-cid" metrics "github.com/libp2p/go-libp2p-core/metrics" "github.com/libp2p/go-libp2p-core/network" @@ -25,6 +21,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/crypto" + "github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/lotus/extern/sector-storage/stores" @@ -37,6 +34,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" + miner2 "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/node/modules/dtypes" ) @@ -168,7 +166,7 @@ type FullNodeStruct struct { StateMinerActiveSectors func(context.Context, address.Address, types.TipSetKey) ([]*api.ChainSectorInfo, error) `perm:"read"` StateMinerProvingDeadline func(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) `perm:"read"` StateMinerPower func(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) `perm:"read"` - StateMinerInfo func(context.Context, address.Address, types.TipSetKey) (miner2.MinerInfo, error) `perm:"read"` + StateMinerInfo func(context.Context, address.Address, types.TipSetKey) (miner2.MinerInfo, error) `perm:"read"` StateMinerFaults func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) `perm:"read"` StateAllMinerFaults func(context.Context, abi.ChainEpoch, types.TipSetKey) ([]*api.Fault, error) `perm:"read"` StateMinerRecoveries func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) `perm:"read"` diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 6c1fec23c..3bed1c1a9 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -6,12 +6,6 @@ import ( "fmt" "math/rand" - "github.com/filecoin-project/lotus/build" - - "github.com/filecoin-project/go-state-types/network" - - "github.com/filecoin-project/lotus/chain/state" - "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" cbg "github.com/whyrusleeping/cbor-gen" @@ -29,6 +23,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/builtin/reward" "github.com/filecoin-project/specs-actors/actors/runtime" + "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/vm" diff --git a/chain/gen/genesis/util.go b/chain/gen/genesis/util.go index 54fc4abfe..6a27f2f29 100644 --- a/chain/gen/genesis/util.go +++ b/chain/gen/genesis/util.go @@ -3,6 +3,7 @@ package genesis import ( "context" "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" @@ -48,7 +49,13 @@ func doExecValue(ctx context.Context, vm *vm.VM, to, from address.Address, value return ret.Return, nil } -var GenesisNetworkVersion = network.Version1 -func genesisNetworkVersion(context.Context, abi.ChainEpoch) network.Version { +var GenesisNetworkVersion = func() network.Version {// TODO: Get from build/ + if build.UseNewestNetwork() {// TODO: Get from build/ + return build.NewestNetworkVersion// TODO: Get from build/ + }// TODO: Get from build/ + return network.Version1// TODO: Get from build/ +}()// TODO: Get from build/ + +func genesisNetworkVersion(context.Context, abi.ChainEpoch) network.Version {// TODO: Get from build/ return GenesisNetworkVersion // TODO: Get from build/ -} +}// TODO: Get from build/