aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/state-change-request.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-12-19 17:16:40 +0800
committerGitHub <noreply@github.com>2018-12-19 17:16:40 +0800
commitc7b4045802450df361216d9e7da3ec318e67cc34 (patch)
treec4060817a54e5cf455e830b21e6a91b9fc11004f /core/test/state-change-request.go
parent7bafefa5c70a26a28636123cb2b6598eea3ed380 (diff)
downloadtangerine-consensus-c7b4045802450df361216d9e7da3ec318e67cc34.tar.gz
tangerine-consensus-c7b4045802450df361216d9e7da3ec318e67cc34.tar.zst
tangerine-consensus-c7b4045802450df361216d9e7da3ec318e67cc34.zip
core: Add a `MPKReady` so `MasterPublicKey` cannot be added afterwards (#375)
* Add type DKGReady * Add DKGReady to interface and state * DKG will wait for MPK to be ready before running * Modify test * Check if self's MPK is registered * Add test for delay add MPK * Rename Ready to MPKReady
Diffstat (limited to 'core/test/state-change-request.go')
-rw-r--r--core/test/state-change-request.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/test/state-change-request.go b/core/test/state-change-request.go
index 1515fd2..83119b5 100644
--- a/core/test/state-change-request.go
+++ b/core/test/state-change-request.go
@@ -39,6 +39,7 @@ const (
StateAddCRS
StateAddDKGComplaint
StateAddDKGMasterPublicKey
+ StateAddDKGMPKReady
StateAddDKGFinal
// Configuration related.
StateChangeNumChains
@@ -115,6 +116,8 @@ func (req *StateChangeRequest) Clone() (copied *StateChangeRequest) {
Round: crsReq.Round,
CRS: crsReq.CRS,
}
+ case StateAddDKGMPKReady:
+ copied.Payload = cloneDKGMPKReady(req.Payload.(*typesDKG.MPKReady))
case StateAddDKGFinal:
copied.Payload = cloneDKGFinalize(req.Payload.(*typesDKG.Finalize))
case StateAddDKGMasterPublicKey:
@@ -154,6 +157,9 @@ func (req *StateChangeRequest) String() (ret string) {
ret += fmt.Sprintf(
"{Type:AddDKGMasterPublicKey %s",
req.Payload.(*typesDKG.MasterPublicKey))
+ case StateAddDKGMPKReady:
+ ret += fmt.Sprintf(
+ "{Type:AddDKGMPKReady %s", req.Payload.(*typesDKG.MPKReady))
case StateAddDKGFinal:
ret += fmt.Sprintf(
"{Type:AddDKGFinal %s", req.Payload.(*typesDKG.Finalize))