Skip to content

Commit

Permalink
Merge pull request #5434 from filecoin-project/feat/pre-migrate
Browse files Browse the repository at this point in the history
Implement pre-migration framework
  • Loading branch information
arajasek authored Jan 28, 2021
2 parents eab50e0 + 4890d83 commit 887d40b
Show file tree
Hide file tree
Showing 6 changed files with 511 additions and 60 deletions.
23 changes: 6 additions & 17 deletions chain/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/google/uuid"
block "github.com/ipfs/go-block-format"
"github.com/ipfs/go-blockservice"
"github.com/ipfs/go-cid"
offline "github.com/ipfs/go-ipfs-exchange-offline"
Expand Down Expand Up @@ -85,19 +84,6 @@ type ChainGen struct {
lr repo.LockedRepo
}

type mybs struct {
blockstore.Blockstore
}

func (m mybs) Get(c cid.Cid) (block.Block, error) {
b, err := m.Blockstore.Get(c)
if err != nil {
return nil, err
}

return b, nil
}

var rootkeyMultisig = genesis.MultisigMeta{
Signers: []address.Address{remAccTestKey},
Threshold: 1,
Expand Down Expand Up @@ -152,8 +138,6 @@ func NewGeneratorWithSectors(numSectors int) (*ChainGen, error) {
}
}()

bs = mybs{bs}

ks, err := lr.KeyStore()
if err != nil {
return nil, xerrors.Errorf("getting repo keystore failed: %w", err)
Expand Down Expand Up @@ -465,7 +449,12 @@ func (cg *ChainGen) NextTipSetFromMinersWithMessages(base *types.TipSet, miners
}
}

return store.NewFullTipSet(blks), nil
fts := store.NewFullTipSet(blks)
if err := cg.cs.PutTipSet(context.TODO(), fts.TipSet()); err != nil {
return nil, err
}

return fts, nil
}

func (cg *ChainGen) makeBlock(parents *types.TipSet, m address.Address, vrfticket *types.Ticket,
Expand Down
Loading

0 comments on commit 887d40b

Please sign in to comment.