stmgr: drop MethdosMap

This commit is contained in:
Łukasz Magiera
2021-09-02 18:58:34 +02:00
parent 30fccaa0bd
commit 727bb84592
10 changed files with 20 additions and 28 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ import (
"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/consensus/filcns"
types "github.com/filecoin-project/lotus/chain/types"
)
@@ -476,7 +476,7 @@ var ChainInspectUsage = &cli.Command{
return err
}
mm := stmgr.MethodsMap[code][m.Message.Method]
mm := filcns.NewActorRegistry().Methods[code][m.Message.Method] // TODO: use remote map
byMethod[mm.Name] += m.Message.GasLimit
byMethodC[mm.Name]++
+4 -5
View File
@@ -10,10 +10,6 @@ import (
"strconv"
"text/tabwriter"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/stmgr"
cbg "github.com/whyrusleeping/cbor-gen"
"github.com/filecoin-project/go-state-types/big"
@@ -31,8 +27,11 @@ import (
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/actors/builtin/multisig"
"github.com/filecoin-project/lotus/chain/consensus/filcns"
"github.com/filecoin-project/lotus/chain/types"
)
@@ -325,7 +324,7 @@ var msigInspectCmd = &cli.Command{
fmt.Fprintf(w, "%d\t%s\t%d\t%s\t%s\t%s(%d)\t%s\n", txid, "pending", len(tx.Approved), target, types.FIL(tx.Value), "new account, unknown method", tx.Method, paramStr)
}
} else {
method := stmgr.MethodsMap[targAct.Code][tx.Method]
method := filcns.NewActorRegistry().Methods[targAct.Code][tx.Method] // TODO: use remote map
if decParams && tx.Method != 0 {
ptyp := reflect.New(method.Params.Elem()).Interface().(cbg.CBORUnmarshaler)
+2 -2
View File
@@ -12,7 +12,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/consensus/filcns"
types "github.com/filecoin-project/lotus/chain/types"
cid "github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
@@ -86,7 +86,7 @@ func (s *ServicesImpl) DecodeTypedParamsFromJSON(ctx context.Context, to address
return nil, err
}
methodMeta, found := stmgr.MethodsMap[act.Code][method]
methodMeta, found := filcns.NewActorRegistry().Methods[act.Code][method] // TODO: use remote map
if !found {
return nil, fmt.Errorf("method %d not found on actor %s", method, act.Code)
}
+2 -2
View File
@@ -1367,7 +1367,7 @@ func codeStr(c cid.Cid) string {
}
func getMethod(code cid.Cid, method abi.MethodNum) string {
return stmgr.MethodsMap[code][method].Name
return filcns.NewActorRegistry().Methods[code][method].Name // todo: use remote
}
func toFil(f types.BigInt) types.FIL {
@@ -1412,7 +1412,7 @@ func JsonParams(code cid.Cid, method abi.MethodNum, params []byte) (string, erro
}
func jsonReturn(code cid.Cid, method abi.MethodNum, ret []byte) (string, error) {
methodMeta, found := stmgr.MethodsMap[code][method]
methodMeta, found := filcns.NewActorRegistry().Methods[code][method] // TODO: use remote
if !found {
return "", fmt.Errorf("method %d not found on actor %s", method, code)
}