aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-08-03 13:57:41 +0800
committerWei-Ning Huang <aitjcize@gmail.com>2018-08-03 13:57:41 +0800
commit101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7 (patch)
tree5e4a57f708d64450d1049c791d7786570a3aa24e /core/types
parent6c4617f42f31014727bdc6f5731c32fc21004101 (diff)
downloaddexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.tar
dexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.tar.gz
dexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.tar.bz2
dexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.tar.lz
dexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.tar.xz
dexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.tar.zst
dexon-consensus-101ce1072667a1a8cfeaa58dc862eb4d0dbec6f7.zip
test: random blocks generator (#26)
* Add blocks generator. This helper would randomly generate blocks that forms valid DAGs. * Add revealer Revealer is an extension of blockdb.BlockIterator. The block sequence from 'Next' method would be either randomly (see RandomRevealer) or meeting some specific condition (ex. forming a DAG, see RandomDAGRevealer). * Add test for sequencer based on random blocks. * 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/types')
-rw-r--r--core/types/block_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/types/block_test.go b/core/types/block_test.go
index feca5b8..8297508 100644
--- a/core/types/block_test.go
+++ b/core/types/block_test.go
@@ -1,3 +1,20 @@
+// Copyright 2018 The dexon-consensus-core Authors
+// This file is part of the dexon-consensus-core library.
+//
+// The dexon-consensus-core library is free software: you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation, either version 3 of the License,
+// or (at your option) any later version.
+//
+// The dexon-consensus-core library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with the dexon-consensus-core library. If not, see
+// <http://www.gnu.org/licenses/>.
+
package types
import (