Skip to content

Commit

Permalink
add chain disputer cmd: for wdPoSt disputer (#4449)
Browse files Browse the repository at this point in the history
Co-authored-by: 一页素书 <[email protected]>
  • Loading branch information
diwufeiwen and ta0li authored May 25, 2021
1 parent 95d0277 commit 707341d
Show file tree
Hide file tree
Showing 4 changed files with 430 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/submodule/apitypes/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ type ProtocolParams struct {
}

type Deadline struct {
PostSubmissions bitfield.BitField
PostSubmissions bitfield.BitField
DisputableProofCount uint64
}

// BlsMessages[x].cid = Cids[x]
Expand Down
8 changes: 7 additions & 1 deletion app/submodule/chain/miner_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,14 @@ func (msa *minerStateAPI) StateMinerDeadlines(ctx context.Context, maddr address
return err
}

l, err := dl.DisputableProofCount()
if err != nil {
return err
}

out[i] = apitypes.Deadline{
PostSubmissions: ps,
PostSubmissions: ps,
DisputableProofCount: l,
}
return nil
}); err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var chainCmd = &cmds.Command{
"ls": chainLsCmd,
"set-head": chainSetHeadCmd,
"getblock": chainGetBlockCmd,
"disputer": chainDisputeSetCmd,
},
}

Expand Down
Loading

0 comments on commit 707341d

Please sign in to comment.