mirror of
https://github.com/filecoin-project/lotus.git
synced 2025-05-17 15:20:37 +08:00
allow verifreg commands in lotus-shed to be run against a gateway
They still expect a 'full node api', but are in practice used with a gateway. Changes to the primary gateway to restrict available methods mean that it's preferable to have only the methods available on the gateay in use for these commands
This commit is contained in:
@ -80,7 +80,20 @@ var verifRegAddVerifierFromMsigCmd = &cli.Command{
|
||||
api := srv.FullNodeAPI()
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
vrk, err := api.StateVerifiedRegistryRootKey(ctx, types.EmptyTSK)
|
||||
vact, err := api.StateGetActor(ctx, verifreg.Address, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
apibs := blockstore.NewAPIBlockstore(api)
|
||||
store := adt.WrapStore(ctx, cbor.NewCborStore(apibs))
|
||||
|
||||
vst, err := verifreg.Load(store, vact)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vrk, err := vst.RootKey()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -460,7 +473,20 @@ var verifRegRemoveVerifiedClientDataCapCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
vrk, err := api.StateVerifiedRegistryRootKey(ctx, types.EmptyTSK)
|
||||
vact, err := api.StateGetActor(ctx, verifreg.Address, types.EmptyTSK)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
apibs := blockstore.NewAPIBlockstore(api)
|
||||
store := adt.WrapStore(ctx, cbor.NewCborStore(apibs))
|
||||
|
||||
vst, err := verifreg.Load(store, vact)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
vrk, err := vst.RootKey()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -470,9 +496,6 @@ var verifRegRemoveVerifiedClientDataCapCmd = &cli.Command{
|
||||
return err
|
||||
}
|
||||
|
||||
apibs := blockstore.NewAPIBlockstore(api)
|
||||
store := adt.WrapStore(ctx, cbor.NewCborStore(apibs))
|
||||
|
||||
st, err := multisig.Load(store, vrkState)
|
||||
if err != nil {
|
||||
return fmt.Errorf("load vrk failed: %w ", err)
|
||||
|
Reference in New Issue
Block a user