Merge pull request #2232 from filecoin-project/feat/verifreg-bitwidth

set proper bitwidth for verifreg command hamts
This commit is contained in:
Łukasz Magiera 2020-07-10 16:19:45 +02:00 committed by GitHub
commit b245fd0b7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,9 @@ package main
import (
"bytes"
"fmt"
"github.com/filecoin-project/lotus/build"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
"github.com/urfave/cli/v2"
@ -199,7 +201,7 @@ var verifRegListVerifiersCmd = &cli.Command{
return err
}
vh, err := hamt.LoadNode(ctx, cst, st.Verifiers)
vh, err := hamt.LoadNode(ctx, cst, st.Verifiers, hamt.UseTreeBitWidth(5))
if err != nil {
return err
}
@ -251,7 +253,7 @@ var verifRegListClientsCmd = &cli.Command{
return err
}
vh, err := hamt.LoadNode(ctx, cst, st.VerifiedClients)
vh, err := hamt.LoadNode(ctx, cst, st.VerifiedClients, hamt.UseTreeBitWidth(5))
if err != nil {
return err
}
@ -312,14 +314,14 @@ var verifRegCheckClientCmd = &cli.Command{
return err
}
vh, err := hamt.LoadNode(ctx, cst, st.VerifiedClients)
vh, err := hamt.LoadNode(ctx, cst, st.VerifiedClients, hamt.UseTreeBitWidth(5))
if err != nil {
return err
}
var dcap verifreg.DataCap
if err := vh.Find(ctx, string(caddr.Bytes()), &dcap); err != nil {
return err
return xerrors.Errorf("failed to lookup address: %w", err)
}
fmt.Println(dcap)
@ -361,7 +363,7 @@ var verifRegCheckVerifierCmd = &cli.Command{
return err
}
vh, err := hamt.LoadNode(ctx, cst, st.Verifiers)
vh, err := hamt.LoadNode(ctx, cst, st.Verifiers, hamt.UseTreeBitWidth(5))
if err != nil {
return err
}