self review, cleanup
This commit is contained in:
parent
a47969c76b
commit
fe2885382c
@ -116,12 +116,6 @@ func (ia InitActor) Exec(act *types.Actor, vmctx types.VMContext, p *ExecParams)
|
||||
Head: EmptyCBOR,
|
||||
Nonce: 0,
|
||||
}
|
||||
/*
|
||||
_, err = vmctx.Storage().Put(struct{}{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
*/
|
||||
|
||||
// The call to the actors constructor will set up the initial state
|
||||
// from the given parameters, setting `actor.Head` to a new value when successful.
|
||||
@ -183,8 +177,6 @@ func (ias *InitActorState) AddActor(cst *hamt.CborIpldStore, addr address.Addres
|
||||
nid := ias.NextID
|
||||
ias.NextID++
|
||||
|
||||
fmt.Println("ADD ACTOR: ", addr.String())
|
||||
|
||||
amap, err := hamt.LoadNode(context.TODO(), cst, ias.AddressMap)
|
||||
if err != nil {
|
||||
return address.Undef, err
|
||||
|
@ -113,7 +113,6 @@ func (pca PaymentChannelActor) UpdateChannelState(act *types.Actor, vmctx types.
|
||||
}
|
||||
|
||||
if err := vmctx.VerifySignature(sv.Signature, self.From, vb); err != nil {
|
||||
fmt.Printf("bad bits: %x", vb)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ package actors_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/filecoin-project/go-lotus/chain/actors"
|
||||
@ -37,7 +36,6 @@ func signVoucher(t *testing.T, w *wallet.Wallet, addr address.Address, sv *types
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Printf("SIGNING: %x\n", vb)
|
||||
sv.Signature = sig
|
||||
}
|
||||
|
||||
|
@ -198,12 +198,12 @@ func (sma StorageMarketActor) IsMiner(act *types.Actor, vmctx types.VMContext, p
|
||||
}
|
||||
|
||||
func MinerSetHas(ctx context.Context, vmctx types.VMContext, rcid cid.Cid, maddr address.Address) (bool, aerrors.ActorError) {
|
||||
nd, err := hamt.LoadNode(context.TODO(), vmctx.Ipld(), rcid)
|
||||
nd, err := hamt.LoadNode(ctx, vmctx.Ipld(), rcid)
|
||||
if err != nil {
|
||||
return false, aerrors.Escalate(err, "failed to load miner set")
|
||||
}
|
||||
|
||||
err = nd.Find(context.TODO(), string(maddr.Bytes()), nil)
|
||||
err = nd.Find(ctx, string(maddr.Bytes()), nil)
|
||||
switch err {
|
||||
case hamt.ErrNotFound:
|
||||
return false, nil
|
||||
|
@ -67,7 +67,8 @@ func (m mybs) Get(c cid.Cid) (block.Block, error) {
|
||||
b, err := m.Blockstore.Get(c)
|
||||
if err != nil {
|
||||
// change to error for stacktraces, don't commit with that pls
|
||||
//log.Warnf("Get failed: %s %s", c, err)
|
||||
// TODO: debug why we get so many not founds in tests
|
||||
log.Warnf("Get failed: %s %s", c, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -119,7 +120,6 @@ func NewGenerator() (*ChainGen, error) {
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to generate receiver key: %w", err)
|
||||
}
|
||||
fmt.Println("RECEIVER KEY: ", receievers[r].String())
|
||||
}
|
||||
|
||||
minercfg := &GenMinerCfg{
|
||||
|
@ -256,7 +256,7 @@ func (tu *syncTestUtil) submitSourceBlocks(to int, h int, n int) {
|
||||
*/
|
||||
|
||||
func TestSyncSimple(t *testing.T) {
|
||||
H := 15
|
||||
H := 50
|
||||
tu := prepSyncTest(t, H)
|
||||
|
||||
client := tu.addClientNode()
|
||||
|
@ -74,7 +74,6 @@ func (vmc *VMContext) Put(i cbg.CBORMarshaler) (cid.Cid, aerrors.ActorError) {
|
||||
if aerr := vmc.ChargeGas(0); aerr != nil {
|
||||
return cid.Undef, aerrors.Absorb(err, outOfGasErrCode, "Put out of gas")
|
||||
}
|
||||
panic("no u")
|
||||
return cid.Undef, aerrors.Escalate(err, fmt.Sprintf("putting object %T", i))
|
||||
}
|
||||
return c, nil
|
||||
@ -319,7 +318,6 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *VMContext,
|
||||
toActor, err := st.GetActor(msg.To)
|
||||
if err != nil {
|
||||
if xerrors.Is(err, types.ErrActorNotFound) {
|
||||
fmt.Println("actor not found on send: ", msg.To.String())
|
||||
a, err := TryCreateAccountActor(st, msg.To)
|
||||
if err != nil {
|
||||
return nil, aerrors.Absorb(err, 1, "could not create account"), nil
|
||||
|
Loading…
Reference in New Issue
Block a user