fixup tests
This commit is contained in:
parent
4f25c1c60e
commit
621d675938
@ -92,10 +92,8 @@ func (m mybs) Get(c cid.Cid) (block.Block, error) {
|
|||||||
return b, nil
|
return b, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var rootkey, _ = address.NewIDAddress(80)
|
|
||||||
|
|
||||||
var rootkeyMultisig = genesis.MultisigMeta{
|
var rootkeyMultisig = genesis.MultisigMeta{
|
||||||
Signers: []address.Address{rootkey},
|
Signers: []address.Address{remAccTestKey},
|
||||||
Threshold: 1,
|
Threshold: 1,
|
||||||
VestingDuration: 0,
|
VestingDuration: 0,
|
||||||
VestingStart: 0,
|
VestingStart: 0,
|
||||||
@ -108,12 +106,13 @@ var DefaultVerifregRootkeyActor = genesis.Actor{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var remAccTestKey, _ = address.NewFromString("t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy")
|
var remAccTestKey, _ = address.NewFromString("t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy")
|
||||||
var remAccMeta = genesis.AccountMeta{
|
var remAccMeta = genesis.MultisigMeta{
|
||||||
Owner: remAccTestKey,
|
Signers: []address.Address{remAccTestKey},
|
||||||
|
Threshold: 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
var DefaultRemainderAccountActor = genesis.Actor{
|
var DefaultRemainderAccountActor = genesis.Actor{
|
||||||
Type: genesis.TAccount,
|
Type: genesis.TMultisig,
|
||||||
Balance: big.NewInt(0),
|
Balance: big.NewInt(0),
|
||||||
Meta: remAccMeta.ActorMeta(),
|
Meta: remAccMeta.ActorMeta(),
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,6 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
_ = vregroot
|
|
||||||
|
|
||||||
if err = createMultisigAccount(ctx, bs, cst, state, vregroot, template.VerifregRootKey, keyIDs); err != nil {
|
if err = createMultisigAccount(ctx, bs, cst, state, vregroot, template.VerifregRootKey, keyIDs); err != nil {
|
||||||
return nil, nil, xerrors.Errorf("failed to set up verified registry signer: %w", err)
|
return nil, nil, xerrors.Errorf("failed to set up verified registry signer: %w", err)
|
||||||
@ -275,8 +274,6 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
|
|||||||
|
|
||||||
totalFilAllocated := big.Zero()
|
totalFilAllocated := big.Zero()
|
||||||
|
|
||||||
fmt.Println("finished basic setup, time for remainder")
|
|
||||||
|
|
||||||
// flush as ForEach works on the HAMT
|
// flush as ForEach works on the HAMT
|
||||||
if _, err := state.Flush(ctx); err != nil {
|
if _, err := state.Flush(ctx); err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
@ -312,7 +309,6 @@ func createAccountActor(ctx context.Context, cst cbor.IpldStore, state *state.St
|
|||||||
if err := json.Unmarshal(info.Meta, &ainfo); err != nil {
|
if err := json.Unmarshal(info.Meta, &ainfo); err != nil {
|
||||||
return xerrors.Errorf("unmarshaling account meta: %w", err)
|
return xerrors.Errorf("unmarshaling account meta: %w", err)
|
||||||
}
|
}
|
||||||
fmt.Println("Creating account: ", ainfo.Owner, keyIDs[ainfo.Owner])
|
|
||||||
st, err := cst.Put(ctx, &account.State{Address: ainfo.Owner})
|
st, err := cst.Put(ctx, &account.State{Address: ainfo.Owner})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -349,21 +345,19 @@ func createMultisigAccount(ctx context.Context, bs bstore.Blockstore, cst cbor.I
|
|||||||
|
|
||||||
var signers []address.Address
|
var signers []address.Address
|
||||||
|
|
||||||
fmt.Println("setting up multisig signers")
|
|
||||||
for _, e := range ainfo.Signers {
|
for _, e := range ainfo.Signers {
|
||||||
fmt.Println("Signer: ", e)
|
|
||||||
idAddress, ok := keyIDs[e]
|
idAddress, ok := keyIDs[e]
|
||||||
fmt.Println("keyIDs map: ", idAddress, ok)
|
if !ok {
|
||||||
|
return fmt.Errorf("no registered key ID for signer: %s", e)
|
||||||
|
}
|
||||||
|
|
||||||
// Check if actor already exists
|
// Check if actor already exists
|
||||||
_, err := state.GetActor(e)
|
_, err := state.GetActor(e)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
fmt.Println("continue signer: ", idAddress)
|
|
||||||
signers = append(signers, idAddress)
|
signers = append(signers, idAddress)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Creating account actor for: ", e, idAddress)
|
|
||||||
st, err := cst.Put(ctx, &account.State{Address: e})
|
st, err := cst.Put(ctx, &account.State{Address: e})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -420,15 +414,6 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, stateroot ci
|
|||||||
}
|
}
|
||||||
|
|
||||||
for mi, m := range template.Miners {
|
for mi, m := range template.Miners {
|
||||||
|
|
||||||
/*
|
|
||||||
// Add the miner to the market actor's balance table
|
|
||||||
_, err = doExec(ctx, vm, builtin.StorageMarketActorAddr, m.Owner, builtin.MethodsMarket.AddBalance, mustEnc(&m.ID))
|
|
||||||
if err != nil {
|
|
||||||
return cid.Undef, xerrors.Errorf("failed to add balance to miner: %w", err)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
for si, s := range m.Sectors {
|
for si, s := range m.Sectors {
|
||||||
if s.Deal.Provider != m.ID {
|
if s.Deal.Provider != m.ID {
|
||||||
return cid.Undef, xerrors.Errorf("Sector %d in miner %d in template had mismatch in provider and miner ID: %s != %s", si, mi, s.Deal.Provider, m.ID)
|
return cid.Undef, xerrors.Errorf("Sector %d in miner %d in template had mismatch in provider and miner ID: %s != %s", si, mi, s.Deal.Provider, m.ID)
|
||||||
|
@ -66,7 +66,7 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if a.Type != genesis.TAccount {
|
if a.Type != genesis.TAccount {
|
||||||
return 0, nil, nil, xerrors.Errorf("unsupported account type: %s", a.Type) // TODO: Support msig (skip here)
|
return 0, nil, nil, xerrors.Errorf("unsupported account type: %s", a.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
var ainfo genesis.AccountMeta
|
var ainfo genesis.AccountMeta
|
||||||
|
@ -2,8 +2,6 @@ package full
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/filecoin-project/specs-actors/actors/abi/big"
|
"github.com/filecoin-project/specs-actors/actors/abi/big"
|
||||||
|
|
||||||
@ -124,12 +122,6 @@ func (a *MsigAPI) MsigPropose(ctx context.Context, msig address.Address, to addr
|
|||||||
Params: enc,
|
Params: enc,
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := json.Marshal(msg)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
fmt.Println("prpopose message: ", string(b))
|
|
||||||
|
|
||||||
smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg, nil)
|
smsg, err := a.MpoolAPI.MpoolPushMessage(ctx, msg, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cid.Undef, xerrors.Errorf("failed to push message: %w", err)
|
return cid.Undef, xerrors.Errorf("failed to push message: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user