Merge pull request #2560 from filecoin-project/feat/state-root-stat

add command to print state size statistics of actors
This commit is contained in:
Łukasz Magiera
2020-07-29 01:08:56 +02:00
committed by GitHub
4 changed files with 126 additions and 4 deletions
+8
View File
@@ -131,7 +131,15 @@ func LoadTipSet(ctx context.Context, cctx *cli.Context, api api.FullNode) (*type
return nil, nil
}
return ParseTipSetRef(ctx, api, tss)
}
func ParseTipSetRef(ctx context.Context, api api.FullNode, tss string) (*types.TipSet, error) {
if tss[0] == '@' {
if tss == "@head" {
return api.ChainHead(ctx)
}
var h uint64
if _, err := fmt.Sscanf(tss, "@%d", &h); err != nil {
return nil, xerrors.Errorf("parsing height tipset ref: %w", err)