Skip to content

Commit

Permalink
[CLOB-1055] - final settlement e2e tests (#926)
Browse files Browse the repository at this point in the history
* write e2e test for passing gov proposal to wind down a market

* verify stateful orders are cancelled when gov proposal executes

* update testcase to cancel more orders

* add indexer assertions for stateful order removals and indexer assertion for clob pair update

* add CheckTx failure validation for placing new orders in final settlement, in e2e tests
  • Loading branch information
jakob-dydx authored Jan 9, 2024
1 parent 832011c commit 4f2d72a
Show file tree
Hide file tree
Showing 14 changed files with 408 additions and 5 deletions.
1 change: 1 addition & 0 deletions protocol/testing/e2e/gov/add_new_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ func TestAddNewMarketProposal(t *testing.T) {
ctx,
tApp,
tc.proposedMsgs,
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFail,
tc.expectedProposalStatus,
Expand Down
3 changes: 3 additions & 0 deletions protocol/testing/e2e/gov/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func TestUpdateEventParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down Expand Up @@ -213,6 +214,7 @@ func TestUpdateProposeParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down Expand Up @@ -278,6 +280,7 @@ func TestUpdateSafetyParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
false,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down
1 change: 1 addition & 0 deletions protocol/testing/e2e/gov/feetiers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func TestUpdateFeeTiersModuleParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down
3 changes: 3 additions & 0 deletions protocol/testing/e2e/gov/perpetuals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func TestUpdatePerpetualsModuleParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFail,
tc.expectedProposalStatus,
Expand Down Expand Up @@ -317,6 +318,7 @@ func TestUpdatePerpetualsParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down Expand Up @@ -467,6 +469,7 @@ func TestSetLiquidityTier(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down
1 change: 1 addition & 0 deletions protocol/testing/e2e/gov/prices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func TestUpdateMarketParam(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down
1 change: 1 addition & 0 deletions protocol/testing/e2e/gov/rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func TestUpdateRewardsModuleParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFails,
tc.expectedProposalStatus,
Expand Down
5 changes: 4 additions & 1 deletion protocol/testing/e2e/gov/sending_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package gov_test

import (
"testing"

sdkmath "cosmossdk.io/math"

"github.com/dydxprotocol/v4-chain/protocol/lib"
"testing"

"github.com/cometbft/cometbft/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -106,6 +108,7 @@ func TestSendFromModuleToAccount(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFail,
tc.expectedProposalStatus,
Expand Down
4 changes: 3 additions & 1 deletion protocol/testing/e2e/gov/stats_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package gov_test

import (
"github.com/dydxprotocol/v4-chain/protocol/lib"
"testing"
"time"

"github.com/dydxprotocol/v4-chain/protocol/lib"

"github.com/cometbft/cometbft/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -71,6 +72,7 @@ func TestUpdateParams(t *testing.T) {
ctx,
tApp,
[]sdk.Msg{tc.msg},
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFail,
tc.expectedProposalStatus,
Expand Down
4 changes: 4 additions & 0 deletions protocol/testing/e2e/gov/vest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ func TestSetVestEntry_Success(t *testing.T) {
ctx,
tApp,
tc.msgs,
testapp.TestSubmitProposalTxHeight,
false, // checkTx should not fail.
false, // submitProposal should not fail.
govtypesv1.ProposalStatus_PROPOSAL_STATUS_PASSED,
Expand Down Expand Up @@ -309,6 +310,7 @@ func TestSetVestEntry_Failure(t *testing.T) {
ctx,
tApp,
tc.msgs,
testapp.TestSubmitProposalTxHeight,
tc.expectCheckTxFails,
tc.expectSubmitProposalFail,
govtypesv1.ProposalStatus_PROPOSAL_STATUS_FAILED,
Expand Down Expand Up @@ -385,6 +387,7 @@ func TestDeleteVestEntry_Success(t *testing.T) {
ctx,
tApp,
tc.msgs,
testapp.TestSubmitProposalTxHeight,
false, // checkTx should not fail.
false, // submitProposal should not fail.
govtypesv1.ProposalStatus_PROPOSAL_STATUS_PASSED,
Expand Down Expand Up @@ -489,6 +492,7 @@ func TestDeleteVestEntry_Failure(t *testing.T) {
ctx,
tApp,
tc.msgs,
testapp.TestSubmitProposalTxHeight,
false, // checkTx should not fail.
tc.expectSubmitProposalFail,
govtypesv1.ProposalStatus_PROPOSAL_STATUS_FAILED,
Expand Down
Loading

0 comments on commit 4f2d72a

Please sign in to comment.