aboutsummaryrefslogtreecommitdiffstats
path: root/core/blocklattice_test.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/blocklattice_test.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/blocklattice_test.go')
-rw-r--r--core/blocklattice_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/blocklattice_test.go b/core/blocklattice_test.go
index 0f78dc5..835c35e 100644
--- a/core/blocklattice_test.go
+++ b/core/blocklattice_test.go
@@ -20,6 +20,7 @@ package core
import (
"sort"
"testing"
+ "time"
"github.com/stretchr/testify/suite"
@@ -42,15 +43,14 @@ type TestApp struct {
Early bool
}
-func (a *TestApp) ValidateBlock(b *types.Block) bool {
- return true
-}
-
-func (a *TestApp) Deliver(blocks []*types.Block, early bool) {
+func (a *TestApp) TotalOrderingDeliver(blocks []*types.Block, early bool) {
a.Outputs = append(a.Outputs, blocks...)
a.Early = early
}
+func (a *TestApp) DeliverBlock(blockHashes common.Hash, timestamp time.Time) {
+}
+
func (a *TestApp) Clear() {
a.Outputs = nil
a.Early = false