Skip to content

Commit

Permalink
Refactor: slashThrottleDequeue to slashThrottleDequeueAction
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Sep 20, 2023
1 parent dcd49a4 commit b04adb3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/e2e/action_rapid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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"),
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -2055,7 +2055,7 @@ type slashThrottleDequeue struct {
}

func (tr TestRun) waitForSlashThrottleDequeue(
action slashThrottleDequeue,
action slashThrottleDequeueAction,
verbose bool,
) {
timeout := time.Now().Add(action.Timeout)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/json_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/steps_downtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func stepsThrottledDowntime(consumerName string) []Step {
},
},
{
Action: slashThrottleDequeue{
Action: slashThrottleDequeueAction{
Chain: ChainID(consumerName),
CurrentQueueSize: 1,
NextQueueSize: 0,
Expand Down

0 comments on commit b04adb3

Please sign in to comment.