aboutsummaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-10-01 11:55:53 +0800
committerGitHub <noreply@github.com>2018-10-01 11:55:53 +0800
commite223a62e70a0a874fcf85e4b9c010741414f100e (patch)
tree79896ff732feb0331f9b49aaee1e21d5ba7e9542 /core/test
parentf2c13bd773c9684356a8a992d783916d49e70b59 (diff)
downloaddexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.tar
dexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.tar.gz
dexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.tar.bz2
dexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.tar.lz
dexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.tar.xz
dexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.tar.zst
dexon-consensus-e223a62e70a0a874fcf85e4b9c010741414f100e.zip
core: use notarySet for BA module. (#153)
Diffstat (limited to 'core/test')
-rw-r--r--core/test/governance.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/test/governance.go b/core/test/governance.go
index 69d8bdd..0fc962b 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -38,6 +38,7 @@ type Governance struct {
lambdaBA time.Duration
lambdaDKG time.Duration
privateKeys map[types.NodeID]crypto.PrivateKey
+ crs map[uint64][]byte
tsig map[uint64]crypto.Signature
DKGComplaint map[uint64][]*types.DKGComplaint
DKGMasterPublicKey map[uint64][]*types.DKGMasterPublicKey
@@ -54,6 +55,7 @@ func NewGovernance(nodeCount int, lambda time.Duration) (
lambdaBA: lambda,
lambdaDKG: lambda * 10,
privateKeys: make(map[types.NodeID]crypto.PrivateKey),
+ crs: map[uint64][]byte{0: []byte("__ DEXON")},
tsig: make(map[uint64]crypto.Signature),
DKGComplaint: make(map[uint64][]*types.DKGComplaint),
DKGMasterPublicKey: make(map[uint64][]*types.DKGMasterPublicKey),
@@ -102,7 +104,12 @@ func (g *Governance) GetConfiguration(_ uint64) *types.Config {
// GetCRS returns the CRS for a given round.
func (g *Governance) GetCRS(round uint64) []byte {
- return []byte("__ DEXON")
+ return g.crs[round]
+}
+
+// ProposeCRS propose a CRS.
+func (g *Governance) ProposeCRS(round uint64, crs []byte) {
+ g.crs[round] = crs
}
// GetPrivateKeys return the private key for that node, this function