-
Notifications
You must be signed in to change notification settings - Fork 0
/
miner.go
30 lines (23 loc) · 842 Bytes
/
miner.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package nv3
import (
"context"
"github.com/chenjianmei111/go-address"
"github.com/chenjianmei111/go-state-types/abi"
cid "github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
miner "github.com/chenjianmei111/specs-actors/actors/builtin/miner"
"github.com/chenjianmei111/specs-actors/actors/states"
)
type minerMigrator struct {
}
func (m *minerMigrator) MigrateState(ctx context.Context, store cbor.IpldStore, head cid.Cid, _ abi.ChainEpoch, _ address.Address, _ *states.Tree) (cid.Cid, error) {
var st miner.State
if err := store.Get(ctx, head, &st); err != nil {
return cid.Undef, err
}
// TODO: https://github.com/chenjianmei111/specs-actors/issues/1177
// - repair broken partitions, deadline info:
// - fix power actor claim with any power delta
newHead, err := store.Put(ctx, &st)
return newHead, err
}