aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-02 14:06:25 +0800
committerGitHub <noreply@github.com>2018-10-02 14:06:25 +0800
commitd7f6db871180b53548aed6a5450e1c5879c90b04 (patch)
treec70b9ef766c3b649c8ca3ac93d79f6f1794be3ce /core
parent658662d42d30c58e4f3951f5c1e99688de295397 (diff)
downloadtangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.tar
tangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.tar.gz
tangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.tar.bz2
tangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.tar.lz
tangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.tar.xz
tangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.tar.zst
tangerine-consensus-d7f6db871180b53548aed6a5450e1c5879c90b04.zip
core: remove ProposeThresholdSignature/GetThresholdSignature (#158)
Also rename the argument name of ProposeCRS.
Diffstat (limited to 'core')
-rw-r--r--core/interfaces.go8
-rw-r--r--core/nodeset-cache_test.go7
-rw-r--r--core/test/governance.go21
3 files changed, 3 insertions, 33 deletions
diff --git a/core/interfaces.go b/core/interfaces.go
index dcaa0c4..d1868a5 100644
--- a/core/interfaces.go
+++ b/core/interfaces.go
@@ -88,18 +88,12 @@ type Governance interface {
GetCRS(round uint64) common.Hash
// Propose a CRS of round.
- ProposeCRS(round uint64, crs []byte)
+ ProposeCRS(round uint64, signedCRS []byte)
// GetNodeSet returns the node set at a given round.
// Return the genesis node set if round == 0.
GetNodeSet(round uint64) []crypto.PublicKey
- // Porpose a ThresholdSignature of round.
- ProposeThresholdSignature(round uint64, signature crypto.Signature)
-
- // Get a ThresholdSignature of round.
- GetThresholdSignature(round uint64) (crypto.Signature, bool)
-
//// DKG-related methods.
// AddDKGComplaint adds a DKGComplaint.
diff --git a/core/nodeset-cache_test.go b/core/nodeset-cache_test.go
index def8450..84e5d54 100644
--- a/core/nodeset-cache_test.go
+++ b/core/nodeset-cache_test.go
@@ -45,13 +45,6 @@ func (g *testGov) GetNodeSet(round uint64) []crypto.PublicKey {
}
return g.curKeys
}
-func (g *testGov) ProposeThresholdSignature(
- round uint64, signature crypto.Signature) {
-}
-func (g *testGov) GetThresholdSignature(
- round uint64) (sig crypto.Signature, exists bool) {
- return
-}
func (g *testGov) AddDKGComplaint(complaint *types.DKGComplaint) {}
func (g *testGov) DKGComplaints(
round uint64) (cs []*types.DKGComplaint) {
diff --git a/core/test/governance.go b/core/test/governance.go
index 62ebef0..6ae2462 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -110,8 +110,8 @@ func (g *Governance) GetCRS(round uint64) common.Hash {
}
// ProposeCRS propose a CRS.
-func (g *Governance) ProposeCRS(round uint64, crs []byte) {
- g.crs[round] = crypto.Keccak256Hash(crs)
+func (g *Governance) ProposeCRS(round uint64, signedCRS []byte) {
+ g.crs[round] = crypto.Keccak256Hash(signedCRS)
}
// GetPrivateKeys return the private key for that node, this function
@@ -123,23 +123,6 @@ func (g *Governance) GetPrivateKeys() (keys []crypto.PrivateKey) {
return
}
-// ProposeThresholdSignature porposes a ThresholdSignature of round.
-func (g *Governance) ProposeThresholdSignature(
- round uint64, signature crypto.Signature) {
- g.lock.Lock()
- defer g.lock.Unlock()
- g.tsig[round] = signature
-}
-
-// GetThresholdSignature gets a ThresholdSignature of round.
-func (g *Governance) GetThresholdSignature(round uint64) (
- sig crypto.Signature, exist bool) {
- g.lock.RLock()
- defer g.lock.RUnlock()
- sig, exist = g.tsig[round]
- return
-}
-
// AddDKGComplaint add a DKGComplaint.
func (g *Governance) AddDKGComplaint(complaint *types.DKGComplaint) {
g.lock.Lock()