Skip to content

Commit

Permalink
comment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Apr 12, 2023
1 parent 5daf260 commit 1455bd5
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions x/poolmanager/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1646,8 +1646,10 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountIn() {
tokenInDenom string
tokenOutMinAmount sdk.Int

// This is an estimate because we do not care about
// testing exact values at this level of abstraction.
// This value was taken from the actual result
// and not manually calculated. This is acceptable
// for this test because we are not testing the math
// but the routing logic.
// The math should be tested per-module.
// We keep this assertion to make sure that the
// actual result is within a reasonable range.
Expand Down Expand Up @@ -1691,10 +1693,6 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountIn() {
// every route individually would fail, but the split route should succeed
tokenOutMinAmount: priceImpactThreshold,

// Note: this value was taken from the actual result
// and not manually calculated. This is acceptable
// for this test because we are not testing the math
// but the routing logic.
expectedTokenOutEstimate: priceImpactThreshold,
},

Expand All @@ -1708,10 +1706,6 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountIn() {
// every route individually would fail, but the split route should succeed
tokenOutMinAmount: priceImpactThreshold.Add(sdk.OneInt()),

// Note: this values were taken from the actual result
// and not manually calculated. This is acceptable
// for this test because we are not testing the math
// but the routing logic.
expectError: types.PriceImpactProtectionExactInError{Actual: priceImpactThreshold, MinAmount: priceImpactThreshold.Add(sdk.OneInt())},
},

Expand Down Expand Up @@ -1854,8 +1848,10 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountOut() {
tokenOutDenom string
tokenInMaxAmount sdk.Int

// This is an estimate because we do not care about
// testing exact values at this level of abstraction.
// This value was taken from the actual result
// and not manually calculated. This is acceptable
// for this test because we are not testing the math
// but the routing logic.
// The math should be tested per-module.
// We keep this assertion to make sure that the
// actual result is within a reasonable range.
Expand Down Expand Up @@ -1899,10 +1895,6 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountOut() {
// every route individually would fail, but the split route should succeed
tokenInMaxAmount: priceImpactThreshold,

// Note: this value was taken from the actual result
// and not manually calculated. This is acceptable
// for this test because we are not testing the math
// but the routing logic.
expectedTokenOutEstimate: priceImpactThreshold,
},

Expand All @@ -1916,10 +1908,6 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountOut() {
// every route individually would fail, but the split route should succeed
tokenInMaxAmount: priceImpactThreshold.Sub(sdk.OneInt()),

// Note: this values were taken from the actual result
// and not manually calculated. This is acceptable
// for this test because we are not testing the math
// but the routing logic.
expectError: types.PriceImpactProtectionExactOutError{Actual: priceImpactThreshold, MaxAmount: priceImpactThreshold.Sub(sdk.OneInt())},
},

Expand Down

0 comments on commit 1455bd5

Please sign in to comment.