Invoker: Use MethodMeta from go-state-types

This commit is contained in:
Aayush
2022-10-19 15:53:26 -04:00
parent 8190658fe9
commit 13b59c9c23
14 changed files with 124 additions and 53 deletions
+2 -2
View File
@@ -494,8 +494,8 @@ var ChainInspectUsage = &cli.Command{
mm := filcns.NewActorRegistry().Methods[code][m.Message.Method] // TODO: use remote map
byMethod[mm.Num] += m.Message.GasLimit
byMethodC[mm.Num]++
byMethod[mm.Name] += m.Message.GasLimit
byMethodC[mm.Name]++
}
type keyGasPair struct {
+1 -2
View File
@@ -327,8 +327,7 @@ func TestInspectUsage(t *testing.T) {
// check for gas by sender
assert.Contains(t, out, "By Sender")
// check for gas by method
methodStr := fmt.Sprintf("By Method:\n%d", builtin.MethodSend)
assert.Contains(t, out, methodStr)
assert.Contains(t, out, "By Method:\nSend")
})
}
+1 -1
View File
@@ -341,7 +341,7 @@ var msigInspectCmd = &cli.Command{
paramStr = string(b)
}
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), method.Num, tx.Method, paramStr)
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), method.Name, tx.Method, paramStr)
}
}
if err := w.Flush(); err != nil {
+1 -1
View File
@@ -1384,7 +1384,7 @@ func codeStr(c cid.Cid) string {
}
func getMethod(code cid.Cid, method abi.MethodNum) string {
return filcns.NewActorRegistry().Methods[code][method].Num // todo: use remote
return filcns.NewActorRegistry().Methods[code][method].Name // todo: use remote
}
func toFil(f types.BigInt) types.FIL {