diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-01-05 08:07:57 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-05 08:07:57 +0800 |
commit | 701b19c75fe5433df0528a901c4e257eb51df34a (patch) | |
tree | e43efd0729ec2ff61d2a1eb4c10ebfe949c31eb1 /core | |
parent | 65f14ef166d7fd3ea30f50366d55777b54fe305f (diff) | |
download | dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.tar dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.tar.gz dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.tar.bz2 dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.tar.lz dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.tar.xz dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.tar.zst dexon-consensus-701b19c75fe5433df0528a901c4e257eb51df34a.zip |
core: add fork reporting interface to governance (#402)
Diffstat (limited to 'core')
-rw-r--r-- | core/interfaces.go | 6 | ||||
-rw-r--r-- | core/test/governance.go | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/interfaces.go b/core/interfaces.go index 2077032..aa87e38 100644 --- a/core/interfaces.go +++ b/core/interfaces.go @@ -144,6 +144,12 @@ type Governance interface { // IsDKGFinal checks if DKG is final. IsDKGFinal(round uint64) bool + + // ReportForkVote reports a node for forking votes. + ReportForkVote(vote1, vote2 *types.Vote) + + // ReportForkBlock reports a node for forking blocks. + ReportForkBlock(block1, block2 *types.Block) } // Ticker define the capability to tick by interval. diff --git a/core/test/governance.go b/core/test/governance.go index 769934b..05ceb62 100644 --- a/core/test/governance.go +++ b/core/test/governance.go @@ -231,6 +231,14 @@ func (g *Governance) IsDKGFinal(round uint64) bool { return g.stateModule.IsDKGFinal(round, int(g.configs[round].DKGSetSize)/3*2) } +// ReportForkVote reports a node for forking votes. +func (g *Governance) ReportForkVote(vote1, vote2 *types.Vote) { +} + +// ReportForkBlock reports a node for forking blocks. +func (g *Governance) ReportForkBlock(block1, block2 *types.Block) { +} + // // Test Utilities // |