aboutsummaryrefslogtreecommitdiffstats
path: root/simulation
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 /simulation
parent3778e956013cad171cd5954686831e2598de3045 (diff)
downloadtangerine-consensus-ea2d10b0c7874e6c1d3dd1cf2487ad2525ebb59c.tar.gz
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 'simulation')
-rw-r--r--simulation/app.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/simulation/app.go b/simulation/app.go
index b6851f8..aea7acf 100644
--- a/simulation/app.go
+++ b/simulation/app.go
@@ -43,13 +43,9 @@ func NewSimApp(id types.ValidatorID, Network PeerServerNetwork) *SimApp {
}
}
-// ValidateBlock validates a given block.
-func (a *SimApp) ValidateBlock(b *types.Block) bool {
- return true
-}
-
-// Deliver is called when blocks are delivered by the total ordering algorithm.
-func (a *SimApp) Deliver(blocks []*types.Block, early bool) {
+// TotalOrderingDeliver is called when blocks are delivered by the total
+// ordering algorithm.
+func (a *SimApp) TotalOrderingDeliver(blocks []*types.Block, early bool) {
now := time.Now()
a.Outputs = blocks
a.Early = early
@@ -74,3 +70,7 @@ func (a *SimApp) Deliver(blocks []*types.Block, early bool) {
a.Network.DeliverBlocks(blockList)
a.DeliverID++
}
+
+// DeliverBlock is called when a block in compaction chain is delivered.
+func (a *SimApp) DeliverBlock(blockHash common.Hash, timestamp time.Time) {
+}