more permissive parsing, also don't set useless actor addr
This commit is contained in:
parent
fe4a8dc183
commit
665b873c96
@ -13,8 +13,6 @@ import (
|
||||
cbor "github.com/ipfs/go-ipld-cbor"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
"github.com/filecoin-project/lotus/genesis"
|
||||
)
|
||||
@ -33,12 +31,6 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi
|
||||
|
||||
for i, a := range initialActors {
|
||||
if a.Type == genesis.TMultisig {
|
||||
addr, _ := address.NewActorAddress(a.Meta)
|
||||
fmt.Printf("init set %s t0%d\n", addr, AccountStart+uint64(i))
|
||||
|
||||
if err := amap.Set(context.TODO(), string(addr.Bytes()), AccountStart+uint64(i)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -257,25 +257,25 @@ func parseMultisigCsv(csvf string) ([]GenAccountEntry, error) {
|
||||
addrs = append(addrs, addr)
|
||||
}
|
||||
|
||||
balance, err := types.ParseFIL(e[2])
|
||||
balance, err := types.ParseFIL(strings.TrimSpace(e[2]))
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse account balance: %w", err)
|
||||
}
|
||||
|
||||
vesting, err := strconv.Atoi(e[3])
|
||||
vesting, err := strconv.Atoi(strings.TrimSpace(e[3]))
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse vesting duration for record %d: %w", i, err)
|
||||
}
|
||||
|
||||
custodianID, err := strconv.Atoi(e[4])
|
||||
custodianID, err := strconv.Atoi(strings.TrimSpace(e[4]))
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse custodianID in record %d: %w", i, err)
|
||||
}
|
||||
threshold, err := strconv.Atoi(e[5])
|
||||
threshold, err := strconv.Atoi(strings.TrimSpace(e[5]))
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to parse multisigM in record %d: %w", i, err)
|
||||
}
|
||||
num, err := strconv.Atoi(e[6])
|
||||
num, err := strconv.Atoi(strings.TrimSpace(e[6]))
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("Number of addresses be integer: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user