aboutsummaryrefslogtreecommitdiffstats
path: root/core/application.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-07-31 22:39:05 +0800
committerGitHub <noreply@github.com>2018-07-31 22:39:05 +0800
commitea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c (patch)
tree19de3fe44b3c4822f78bd2405f99c07c1130cdd8 /core/application.go
parent3778e956013cad171cd5954686831e2598de3045 (diff)
downloadtangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar
tangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar.gz
tangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar.bz2
tangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar.lz
tangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar.xz
tangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar.zst
tangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.zip
core: refine Application interface and add Governance interface (#24)
Add a new Governance interface for interaction with the governance contract. Also remove the ValidateBlock call in application interface as the application should validate it before putting it into the consensus module. A new BlockConverter interface is also added. The consensus module should accept the BlockConverter interface in future implementation, and use the Block() function to get the underlying block info.
Diffstat (limited to 'core/application.go')
-rw-r--r--core/application.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/application.go b/core/application.go
index 7eca66e..edeb686 100644
--- a/core/application.go
+++ b/core/application.go
@@ -17,11 +17,20 @@
package core
-import "github.com/dexon-foundation/dexon-consensus-core/core/types"
+import (
+ "time"
+
+ "github.com/dexon-foundation/dexon-consensus-core/common"
+ "github.com/dexon-foundation/dexon-consensus-core/core/types"
+)
// Application describes the application interface that interacts with DEXON
// consensus core.
type Application interface {
- ValidateBlock(b *types.Block) bool
- Deliver(blocks []*types.Block, early bool)
+ // TotalOrderingDeliver is called when the total ordering algorithm deliver
+ // a set of block.
+ TotalOrderingDeliver(blocks []*types.Block, early bool)
+
+ // DeliverBlock is called when a block is add to the compaction chain.
+ DeliverBlock(blockHash common.Hash, timestamp time.Time)
}