From b04adb33803ede59ddf9e488fb583fe38948d00d Mon Sep 17 00:00:00 2001
From: Philip Offtermatt
Date: Wed, 20 Sep 2023 14:45:25 +0200
Subject: [PATCH] Refactor: slashThrottleDequeue to slashThrottleDequeueAction
---
tests/e2e/action_rapid_test.go | 8 ++++----
tests/e2e/actions.go | 8 ++++----
tests/e2e/json_utils.go | 2 +-
tests/e2e/main.go | 2 +-
tests/e2e/steps_downtime.go | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/tests/e2e/action_rapid_test.go b/tests/e2e/action_rapid_test.go
index 4718dc9abc..5f679e42d6 100644
--- a/tests/e2e/action_rapid_test.go
+++ b/tests/e2e/action_rapid_test.go
@@ -84,7 +84,7 @@ func GetActionGen() *rapid.Generator[any] {
GetRegisterRepresentativeActionGen().AsAny(),
GetDoublesignSlashActionGen().AsAny(),
GetAssignConsumerPubKeyActionGen().AsAny(),
- GetSlashThrottleDequeueGen().AsAny(),
+ GetSlashThrottleDequeueActionGen().AsAny(),
GetCreateIbcClientsActionGen().AsAny(),
CreateCancelUnbondTokensActionGen().AsAny(),
CreateLightClientEquivocationAttackActionGen().AsAny(),
@@ -479,9 +479,9 @@ func GetAssignConsumerPubKeyActionGen() *rapid.Generator[assignConsumerPubKeyAct
})
}
-func GetSlashThrottleDequeueGen() *rapid.Generator[slashThrottleDequeue] {
- return rapid.Custom(func(t *rapid.T) slashThrottleDequeue {
- return slashThrottleDequeue{
+func GetSlashThrottleDequeueActionGen() *rapid.Generator[slashThrottleDequeueAction] {
+ return rapid.Custom(func(t *rapid.T) slashThrottleDequeueAction {
+ return slashThrottleDequeueAction{
Chain: GetChainIDGen().Draw(t, "Chain"),
CurrentQueueSize: rapid.Int().Draw(t, "CurrentQueueSize"),
NextQueueSize: rapid.Int().Draw(t, "NextQueueSize"),
diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go
index 36e0c47dd2..408c9066fc 100644
--- a/tests/e2e/actions.go
+++ b/tests/e2e/actions.go
@@ -2045,8 +2045,8 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos
tr.waitBlocks(ChainID("provi"), 2, 30*time.Second)
}
-// slashThrottleDequeue polls slash queue sizes until nextQueueSize is achieved
-type slashThrottleDequeue struct {
+// slashThrottleDequeueAction polls slash queue sizes until nextQueueSize is achieved
+type slashThrottleDequeueAction struct {
Chain ChainID
CurrentQueueSize int
NextQueueSize int
@@ -2055,7 +2055,7 @@ type slashThrottleDequeue struct {
}
func (tr TestRun) waitForSlashThrottleDequeue(
- action slashThrottleDequeue,
+ action slashThrottleDequeueAction,
verbose bool,
) {
timeout := time.Now().Add(action.Timeout)
@@ -2077,7 +2077,7 @@ func (tr TestRun) waitForSlashThrottleDequeue(
}
if time.Now().After(timeout) {
- panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeuemethod has timed out after: %s\n\n", action.Timeout))
+ panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeue method has timed out after: %s\n\n", action.Timeout))
}
time.Sleep(500 * time.Millisecond)
diff --git a/tests/e2e/json_utils.go b/tests/e2e/json_utils.go
index 62e6882735..57d22f086e 100644
--- a/tests/e2e/json_utils.go
+++ b/tests/e2e/json_utils.go
@@ -205,7 +205,7 @@ func UnmarshalMapToActionType(rawAction json.RawMessage, actionTypeString string
return a, nil
}
case "main.slashThrottleDequeue":
- var a slashThrottleDequeue
+ var a slashThrottleDequeueAction
err := json.Unmarshal(rawAction, &a)
if err == nil {
return a, nil
diff --git a/tests/e2e/main.go b/tests/e2e/main.go
index 0a376664a0..d24f42676a 100644
--- a/tests/e2e/main.go
+++ b/tests/e2e/main.go
@@ -254,7 +254,7 @@ func (tr *TestRun) runStep(step Step, verbose bool) {
tr.registerRepresentative(action, verbose)
case assignConsumerPubKeyAction:
tr.assignConsumerPubKey(action, verbose)
- case slashThrottleDequeue:
+ case slashThrottleDequeueAction:
tr.waitForSlashThrottleDequeue(action, verbose)
case startRelayerAction:
tr.startRelayer(action, verbose)
diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go
index 08054f9089..7b4152023b 100644
--- a/tests/e2e/steps_downtime.go
+++ b/tests/e2e/steps_downtime.go
@@ -381,7 +381,7 @@ func stepsThrottledDowntime(consumerName string) []Step {
},
},
{
- Action: slashThrottleDequeue{
+ Action: slashThrottleDequeueAction{
Chain: ChainID(consumerName),
CurrentQueueSize: 1,
NextQueueSize: 0,