diff options
-rw-r--r-- | core/interfaces.go | 8 | ||||
-rw-r--r-- | core/nodeset-cache_test.go | 7 | ||||
-rw-r--r-- | core/test/governance.go | 21 | ||||
-rw-r--r-- | simulation/governance.go | 17 |
4 files changed, 5 insertions, 48 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() diff --git a/simulation/governance.go b/simulation/governance.go index 21bf35a..8b6c3e5 100644 --- a/simulation/governance.go +++ b/simulation/governance.go @@ -113,8 +113,8 @@ func (g *simGovernance) GetCRS(round uint64) common.Hash { } // ProposeCRS proposes a CRS of round. -func (g *simGovernance) ProposeCRS(round uint64, crs []byte) { - g.crs[round] = crypto.Keccak256Hash(crs) +func (g *simGovernance) ProposeCRS(round uint64, signedCRS []byte) { + g.crs[round] = crypto.Keccak256Hash(signedCRS) } // addNode add a new node into the simulated governance contract. @@ -133,19 +133,6 @@ func (g *simGovernance) addNode(pubKey crypto.PublicKey) { g.nodeSet[nID] = pubKey } -// ProposeThresholdSignature porposes a ThresholdSignature of round. -func (g *simGovernance) ProposeThresholdSignature( - round uint64, signature crypto.Signature) { - g.tsig[round] = signature -} - -// GetThresholdSignature gets a ThresholdSignature of round. -func (g *simGovernance) GetThresholdSignature(round uint64) ( - sig crypto.Signature, exist bool) { - sig, exist = g.tsig[round] - return -} - // AddDKGComplaint adds a DKGComplaint. func (g *simGovernance) AddDKGComplaint(complaint *types.DKGComplaint) { // TODO(jimmy-dexon): check if the input is valid. |