Skip to content

Commit

Permalink
set the default taker fee back to non zero for e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Aug 27, 2023
1 parent 0f2da85 commit d129ea3
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ var (

// TODO: Find more scalable way to do this
func (s *IntegrationTestSuite) TestAllE2E() {
// Reset the default taker fee to 0.15%, so we can actually run tests with it activated
s.T().Run("SetDefaultTakerFeeBothChains", func(t *testing.T) {
s.T().Log("resetting the default taker fee to 0.15%")
s.SetDefaultTakerFeeBothChains()
})

// Zero Dependent Tests
s.T().Run("CreateConcentratedLiquidityPoolVoting_And_TWAP", func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -1817,3 +1823,36 @@ func (s *IntegrationTestSuite) GeometricTWAP() {
// quote assset supply / base asset supply = 1_000_000 / 2_000_000 = 0.5
osmoassert.DecApproxEq(s.T(), sdk.NewDecWithPrec(5, 1), afterSwapTwapBOverA, sdk.NewDecWithPrec(1, 2))
}

func (s *IntegrationTestSuite) SetDefaultTakerFeeBothChains() {
var wg sync.WaitGroup
wg.Add(2)

// Chain A

go func() {
defer wg.Done()
chainA, chainANode, err := s.getChainACfgs()
s.Require().NoError(err)
s.SetDefaultTakerFee(chainA, chainANode)
}()

// Chain B

go func() {
defer wg.Done()
chainB, chainBNode, err := s.getChainBCfgs()
s.Require().NoError(err)
s.SetDefaultTakerFee(chainB, chainBNode)
}()

// Wait for all goroutines to complete
wg.Wait()
}

func (s *IntegrationTestSuite) SetDefaultTakerFee(chain *chain.Config, chainNode *chain.NodeConfig) {
// Change the parameter to set the default taker fee to a non zero value

err := chainNode.ParamChangeProposal("poolmanager", string(poolmanagertypes.KeyDefaultTakerFee), json.RawMessage(`"0.001500000000000000"`), chain)
s.Require().NoError(err)
}

0 comments on commit d129ea3

Please sign in to comment.