From d9502693f029271783ab82efcc016d9f9d44fc86 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 16 May 2020 12:53:51 -0700 Subject: [PATCH] add tipset key and height to html trace output --- cli/state.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/state.go b/cli/state.go index b98478d69..b68f60fb5 100644 --- a/cli/state.go +++ b/cli/state.go @@ -892,7 +892,7 @@ var stateComputeStateCmd = &cli.Command{ return c.Code, nil } - return computeStateHtml(stout, getCode) + return computeStateHtml(ts, stout, getCode) } fmt.Println("computed state cid: ", stout.Root) @@ -921,7 +921,7 @@ func codeStr(c cid.Cid) string { return string(cmh.Digest) } -func computeStateHtml(o *api.ComputeStateOutput, getCode func(addr address.Address) (cid.Cid, error)) error { +func computeStateHtml(ts *types.TipSet, o *api.ComputeStateOutput, getCode func(addr address.Address) (cid.Cid, error)) error { fmt.Printf(` +
Tipset: %s
+
Height: %d
State CID: %s
-
Calls
`, o.Root) +
Calls
`, ts.Key(), ts.Height(), o.Root) for _, ir := range o.Trace { toCode, err := getCode(ir.Msg.To)