From 564b88af52a71eb9e347f42410f0d422473e6f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 10 Dec 2020 19:36:02 +0100 Subject: [PATCH] docsgen, lint --- api/docgen/docgen.go | 3 +++ documentation/en/api-methods-miner.md | 32 +++++++++++++++++++++++++++ node/impl/storminer.go | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index 074b6a787..29bf89936 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -237,6 +237,9 @@ func init() { addExample(map[abi.SectorNumber]string{ 123: "can't acquire read lock", }) + addExample(map[api.SectorState]int{ + api.SectorState(sealing.Proving): 120, + }) // worker specific addExample(storiface.AcquireMove) diff --git a/documentation/en/api-methods-miner.md b/documentation/en/api-methods-miner.md index 9bad3d424..7ac714ee1 100644 --- a/documentation/en/api-methods-miner.md +++ b/documentation/en/api-methods-miner.md @@ -97,8 +97,10 @@ * [SectorStartSealing](#SectorStartSealing) * [Sectors](#Sectors) * [SectorsList](#SectorsList) + * [SectorsListInStates](#SectorsListInStates) * [SectorsRefs](#SectorsRefs) * [SectorsStatus](#SectorsStatus) + * [SectorsSummary](#SectorsSummary) * [SectorsUpdate](#SectorsUpdate) * [Storage](#Storage) * [StorageAddLocal](#StorageAddLocal) @@ -1496,6 +1498,21 @@ Inputs: `null` Response: `null` +### SectorsListInStates +List sectors in particular states + + +Perms: read + +Inputs: +```json +[ + null +] +``` + +Response: `null` + ### SectorsRefs There are not yet any comments for this method. @@ -1564,6 +1581,21 @@ Response: } ``` +### SectorsSummary +Get summary info of sectors + + +Perms: read + +Inputs: `null` + +Response: +```json +{ + "Proving": 120 +} +``` + ### SectorsUpdate There are not yet any comments for this method. diff --git a/node/impl/storminer.go b/node/impl/storminer.go index bedff5999..6eb2d3bf7 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -255,7 +255,7 @@ func (sm *StorageMinerAPI) SectorsSummary(ctx context.Context) (map[api.SectorSt out := make(map[api.SectorState]int) for i := range sectors { state := api.SectorState(sectors[i].State) - out[state] += 1 + out[state]++ } return out, nil