Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
none00y committed Aug 29, 2024
1 parent b0e5892 commit c81fc18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sdk/tests/crosses-testnet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('testnet-crosses-limitations', async () => {
}

const swapper = keyring.addFromUri('//Bob')
const swapAmount = 459500n
const swapAmount = 758215n
const tokenX = isTokenX(token0Address, token1Address) ? token0Address : token1Address

await psp22.mint(swapper, swapAmount, tokenX)
Expand All @@ -74,6 +74,6 @@ describe('testnet-crosses-limitations', async () => {
const crossed = Math.abs(
integerSafeCast((poolAfterSwap.currentTickIndex - poolBeforeSwap.currentTickIndex) / 10n)
)
assert.equal(crossed, 90)
assert.equal(crossed, 146)
})
})
6 changes: 3 additions & 3 deletions src/contracts/storage/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ mod tests {
PoolKey::default(),
&mut lower_tick,
&mut upper_tick,
current_timestamp*1000,
current_timestamp * 1000,
Liquidity::new(100000000),
pool_before.sqrt_price,
pool_before.sqrt_price,
Expand Down Expand Up @@ -545,7 +545,7 @@ mod tests {
PoolKey::default(),
&mut lower_tick,
&mut upper_tick,
current_timestamp*1000,
current_timestamp * 1000,
Liquidity::new(100000000),
pool_before.sqrt_price,
pool_before.sqrt_price,
Expand Down Expand Up @@ -574,7 +574,7 @@ mod tests {
PoolKey::default(),
&mut lower_tick,
&mut upper_tick,
(current_timestamp + 1)*1000,
(current_timestamp + 1) * 1000,
Liquidity::new(100000000),
pool_before.sqrt_price,
pool_before.sqrt_price,
Expand Down
6 changes: 3 additions & 3 deletions src/e2e/max_tick_cross.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub mod e2e_tests {
.unwrap();
assert_eq!(pool.liquidity, liquidity);

let amount = 755_000;
let amount = 702_500;
let bob = ink_e2e::bob();
mint!(client, token_x, address_of!(Bob), amount, bob).unwrap();
let amount_x = balance_of!(client, token_x, address_of!(Bob));
Expand Down Expand Up @@ -113,7 +113,7 @@ pub mod e2e_tests {
let crosses_after_quote =
((pool_after_quote.current_tick_index - pool_before.current_tick_index) / 10).abs();
assert_eq!(crosses_after_quote, 0);
assert_eq!(quote_result.ticks.len(), 145);
assert_eq!(quote_result.ticks.len(), 135);

swap!(
client,
Expand All @@ -137,7 +137,7 @@ pub mod e2e_tests {
.unwrap();

let crosses = ((pool_after.current_tick_index - pool_before.current_tick_index) / 10).abs();
assert_eq!(crosses, 145);
assert_eq!(crosses, 135);
assert_eq!(
pool_after.current_tick_index,
get_tick_at_sqrt_price(quote_result.target_sqrt_price, 10).unwrap()
Expand Down

0 comments on commit c81fc18

Please sign in to comment.