Skip to content

Commit

Permalink
add chain disputer cmd: for wdPoSt disputer
Browse files Browse the repository at this point in the history
  • Loading branch information
ta0li committed May 25, 2021
1 parent 95d0277 commit cd12f8a
Show file tree
Hide file tree
Showing 4 changed files with 430 additions and 3 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
10 changes: 8 additions & 2 deletions 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
}

out[i] = apitypes.Deadline{
PostSubmissions: ps,
l, err := dl.DisputableProofCount()
if err != nil {
return err
}

out[i] = Deadline{
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 cd12f8a

Please sign in to comment.