Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsitrin committed Aug 11, 2024
1 parent 3bb4883 commit d06b8ea
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 44 deletions.
81 changes: 47 additions & 34 deletions x/rollapp/keeper/block_height_to_finalization_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ func (suite *RollappTestSuite) TestFinalizeRollapps() {
}, {
rollappId: "rollappa_2345-1",
stateUpdates: []stateUpdate{{
blockHeight: initialHeight, startHeight: 1, numOfBlocks: 10}},
blockHeight: initialHeight, startHeight: 1, numOfBlocks: 10,
}},
},
},
finalizations: []blockEnd{
Expand All @@ -155,7 +156,8 @@ func (suite *RollappTestSuite) TestFinalizeRollapps() {
{
rollappId: "rollapp_1234-1",
stateUpdates: []stateUpdate{{
blockHeight: initialHeight, startHeight: 1, numOfBlocks: 10}},
blockHeight: initialHeight, startHeight: 1, numOfBlocks: 10,
}},
}, {
rollappId: "rollappa_2345-1",
stateUpdates: []stateUpdate{{
Expand All @@ -170,7 +172,8 @@ func (suite *RollappTestSuite) TestFinalizeRollapps() {
rollappsLeft: []rollappQueue{{
rollappId: "rollappa_2345-1",
index: 1,
}}}},
}},
}},
},
},
},
Expand Down Expand Up @@ -216,54 +219,64 @@ func (suite *RollappTestSuite) TestFinalizeRollapps() {
{
// first finalization: 4 states finalized, 3 states left
wantNumFinalized: 4,
wantQueue: []queue{{
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 1,
}, {
rollappId: "rollappo_5678-1",
index: 1,
}}}, {
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 2,
wantQueue: []queue{
{
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 1,
}, {
rollappId: "rollappo_5678-1",
index: 1,
},
},
}},
}, {
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 2,
},
},
},
},
}, {
// second finalization: 1 state finalized from first finalization, 2 states left
wantNumFinalized: 1,
recovers: map[types.StateInfoIndex]struct{}{
{RollappId: "rollappi_4567-1", Index: 1}: {},
},
wantQueue: []queue{{
rollappsLeft: []rollappQueue{
{
rollappId: "rollappo_5678-1",
index: 1,
}}}, {
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 2,
wantQueue: []queue{
{
rollappsLeft: []rollappQueue{
{
rollappId: "rollappo_5678-1",
index: 1,
},
},
}},
}, {
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 2,
},
},
},
},
}, {
// third finalization: 1 state finalized from first finalization, 1 state left
wantNumFinalized: 1,
recovers: map[types.StateInfoIndex]struct{}{
{RollappId: "rollappo_5678-1", Index: 1}: {},
},
wantQueue: []queue{{
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 2,
wantQueue: []queue{
{
rollappsLeft: []rollappQueue{
{
rollappId: "rollappi_4567-1",
index: 2,
},
},
}},
},
},
}, {
// fourth finalization: 1 state finalized from first finalization, 0 states left
Expand Down
10 changes: 0 additions & 10 deletions x/rollapp/keeper/msg_server_update_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
// TODO: refactor the tests to use test-cases
// TODO: wrap the create rollapp and sequencer into a helper function
func (suite *RollappTestSuite) TestFirstUpdateState() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down Expand Up @@ -69,7 +68,6 @@ func (suite *RollappTestSuite) TestFirstUpdateState() {
}

func (suite *RollappTestSuite) TestUpdateState() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// parameters
Expand Down Expand Up @@ -180,7 +178,6 @@ func (suite *RollappTestSuite) TestUpdateState() {
}

func (suite *RollappTestSuite) TestUpdateStateUnknownRollappId() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// update state of unknown rollapp
Expand All @@ -199,7 +196,6 @@ func (suite *RollappTestSuite) TestUpdateStateUnknownRollappId() {

// FIXME: need to add sequncer to rollapp to test this scenario
func (suite *RollappTestSuite) TestUpdateStateUnknownSequencer() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down Expand Up @@ -227,7 +223,6 @@ func (suite *RollappTestSuite) TestUpdateStateUnknownSequencer() {
}

func (suite *RollappTestSuite) TestUpdateStateSequencerRollappMismatch() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down Expand Up @@ -264,7 +259,6 @@ func (suite *RollappTestSuite) TestUpdateStateSequencerRollappMismatch() {
}

func (suite *RollappTestSuite) TestUpdateStateErrLogicUnpermissioned() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

rollappID := urand.RollappID()
Expand Down Expand Up @@ -303,7 +297,6 @@ func (suite *RollappTestSuite) TestUpdateStateErrLogicUnpermissioned() {
}

func (suite *RollappTestSuite) TestFirstUpdateStateGensisHeightGreaterThanZero() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down Expand Up @@ -341,7 +334,6 @@ func (suite *RollappTestSuite) TestFirstUpdateStateGensisHeightGreaterThanZero()
}

func (suite *RollappTestSuite) TestUpdateStateErrWrongBlockHeight() {

_ = sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down Expand Up @@ -401,7 +393,6 @@ func (suite *RollappTestSuite) TestUpdateStateErrWrongBlockHeight() {
}

func (suite *RollappTestSuite) TestUpdateStateErrLogicMissingStateInfo() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down Expand Up @@ -447,7 +438,6 @@ func (suite *RollappTestSuite) TestUpdateStateErrLogicMissingStateInfo() {

// TODO: should test all status other than Proposer
func (suite *RollappTestSuite) TestUpdateStateErrNotActiveSequencer() {

goCtx := sdk.WrapSDKContext(suite.Ctx)

// set rollapp
Expand Down

0 comments on commit d06b8ea

Please sign in to comment.