From 66cafc7c71ce4e9294187ab0a57c8c95a7a11a82 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Tue, 5 May 2020 14:36:39 -0700 Subject: [PATCH] fake signatures when constructing genesis state --- chain/gen/genesis/miners.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 07a2d0fbf..ccf422bbe 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -20,6 +20,7 @@ import ( "github.com/filecoin-project/specs-actors/actors/builtin/miner" "github.com/filecoin-project/specs-actors/actors/builtin/power" "github.com/filecoin-project/specs-actors/actors/crypto" + "github.com/filecoin-project/specs-actors/actors/runtime" "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/store" @@ -37,8 +38,16 @@ func MinerAddress(genesisIndex uint64) address.Address { return maddr } +type fakedSigSyscalls struct { + runtime.Syscalls +} + +func (fss *fakedSigSyscalls) VerifySignature(signature crypto.Signature, signer address.Address, plaintext []byte) error { + return nil +} + func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid, miners []genesis.Miner) (cid.Cid, error) { - vm, err := vm.NewVM(sroot, 0, &fakeRand{}, cs.Blockstore(), cs.VMSys()) + vm, err := vm.NewVM(sroot, 0, &fakeRand{}, cs.Blockstore(), &fakedSigSyscalls{cs.VMSys()}) if err != nil { return cid.Undef, xerrors.Errorf("failed to create NewVM: %w", err) }