diff --git a/cli/multisig.go b/cli/multisig.go index e2ff4e5a7..57f6c2c03 100644 --- a/cli/multisig.go +++ b/cli/multisig.go @@ -12,6 +12,7 @@ import ( "text/tabwriter" "github.com/filecoin-project/specs-actors/actors/abi" + "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/util/adt" "github.com/filecoin-project/go-address" @@ -231,10 +232,10 @@ var msigInspectCmd = &cli.Command{ }) w := tabwriter.NewWriter(os.Stdout, 8, 4, 0, ' ', 0) - fmt.Fprintf(w, "ID\tState\tTo\tValue\tMethod\tParams\n") + fmt.Fprintf(w, "ID\tState\tApprovals\tTo\tValue\tMethod\tParams\n") for _, txid := range txids { tx := pending[txid] - fmt.Fprintf(w, "%d\t%s\t%s\t%s\t%d\t%x\n", txid, state(tx), tx.To, types.FIL(tx.Value), tx.Method, tx.Params) + fmt.Fprintf(w, "%d\t%s\t%d\t%s\t%s\t%d\t%x\n", txid, state(tx), len(tx.Approved), tx.To, types.FIL(tx.Value), tx.Method, tx.Params) } if err := w.Flush(); err != nil { return xerrors.Errorf("flushing output: %+v", err) @@ -355,6 +356,15 @@ var msigProposeCmd = &cli.Command{ from = defaddr } + act, err := api.StateGetActor(ctx, msig, types.EmptyTSK) + if err != nil { + return fmt.Errorf("failed to look up multisig %s: %w", msig, err) + } + + if act.Code != builtin.MultisigActorCodeID { + return fmt.Errorf("actor %s is not a multisig actor", msig) + } + msgCid, err := api.MsigPropose(ctx, msig, dest, types.BigInt(value), from, method, params) if err != nil { return err diff --git a/cli/state.go b/cli/state.go index 5e9952685..c8daade15 100644 --- a/cli/state.go +++ b/cli/state.go @@ -562,10 +562,30 @@ var stateGetActorCmd = &cli.Command{ return err } + var strtype string + switch a.Code { + case builtin.AccountActorCodeID: + strtype = "account" + case builtin.MultisigActorCodeID: + strtype = "multisig" + case builtin.CronActorCodeID: + strtype = "cron" + case builtin.InitActorCodeID: + strtype = "init" + case builtin.StorageMinerActorCodeID: + strtype = "miner" + case builtin.StorageMarketActorCodeID: + strtype = "market" + case builtin.StoragePowerActorCodeID: + strtype = "power" + default: + strtype = "unknown" + } + fmt.Printf("Address:\t%s\n", addr) fmt.Printf("Balance:\t%s\n", types.FIL(a.Balance)) fmt.Printf("Nonce:\t\t%d\n", a.Nonce) - fmt.Printf("Code:\t\t%s\n", a.Code) + fmt.Printf("Code:\t\t%s (%s)\n", a.Code, strtype) fmt.Printf("Head:\t\t%s\n", a.Head) return nil