Skip to content

Commit

Permalink
update hardcoded gas amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnya97 committed Jan 24, 2022
1 parent fffe5f4 commit aaf9565
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions x/gamm/keeper/gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (suite *KeeperTestSuite) TestJoinPoolGas() {
suite.Require().NoError(err)

firstJoinGas := suite.measureJoinPoolGas(defaultAddr, poolId, minShareOutAmount, defaultCoins)
suite.Assert().Equal(65679, int(firstJoinGas))
suite.Assert().Equal(74604, int(firstJoinGas))

for i := 1; i < startAveragingAt; i++ {
err := suite.app.GAMMKeeper.JoinPool(suite.ctx, defaultAddr, poolId, minShareOutAmount, sdk.Coins{})
Expand All @@ -80,8 +80,8 @@ func (suite *KeeperTestSuite) TestJoinPoolGas() {

avgGas, maxGas := suite.measureAvgAndMaxJoinPoolGas(totalNumJoins, defaultAddr, poolIDFn, minShareOutAmountFn, maxCoinsFn)
fmt.Printf("test deets: total %d of pools joined, begin average at %d\n", totalNumJoins, startAveragingAt)
suite.Assert().Equal(67194, int(avgGas), "average gas / join pool")
suite.Assert().Equal(67293, int(maxGas), "max gas / join pool")
suite.Assert().Equal(76119, int(avgGas), "average gas / join pool")
suite.Assert().Equal(76218, int(maxGas), "max gas / join pool")
}

func (suite *KeeperTestSuite) TestRepeatedJoinPoolDistinctDenom() {
Expand Down
10 changes: 5 additions & 5 deletions x/lockup/keeper/gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ func (suite *KeeperTestSuite) TestRepeatedLockTokensGas() {
totalNumLocks := 10000

firstLockGasAmount := suite.measureLockGas(defaultAddr, defaultCoins, time.Second)
suite.Assert().Equal(70305, int(firstLockGasAmount))
suite.Assert().Equal(86844, int(firstLockGasAmount))

for i := 1; i < startAveragingAt; i++ {
suite.LockTokens(defaultAddr, defaultCoins, time.Second)
}
avgGas, maxGas := suite.measureAvgAndMaxLockGas(totalNumLocks-startAveragingAt, defaultAddr, coinsFn, durFn)
fmt.Printf("test deets: total locks created %d, begin average at %d\n", totalNumLocks, startAveragingAt)
suite.Assert().Equal(59527, int(avgGas), "average gas / lock")
suite.Assert().Equal(59617, int(maxGas), "max gas / lock")
suite.Assert().Equal(74047, int(avgGas), "average gas / lock")
suite.Assert().Equal(74137, int(maxGas), "max gas / lock")
}

func (suite *KeeperTestSuite) TestRepeatedLockTokensDistinctDurationGas() {
Expand All @@ -76,6 +76,6 @@ func (suite *KeeperTestSuite) TestRepeatedLockTokensDistinctDurationGas() {

avgGas, maxGas := suite.measureAvgAndMaxLockGas(totalNumLocks, defaultAddr, coinsFn, durFn)
fmt.Printf("test deets: total locks created %d\n", totalNumLocks)
suite.Assert().EqualValues(106225, int(avgGas), "average gas / lock")
suite.Assert().EqualValues(226812, int(maxGas), "max gas / lock")
suite.Assert().EqualValues(124222, int(avgGas), "average gas / lock")
suite.Assert().EqualValues(253920, int(maxGas), "max gas / lock")
}

0 comments on commit aaf9565

Please sign in to comment.