Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed May 25, 2021
1 parent 8df1951 commit 2ba4a9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions core/tests/ts-tests/tests/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Tester.prototype.testSwapNFT = async function (
tokenBuy: nft,
amount,
ratio: utils.weiRatio({
token: amount,
nft: 1
[token]: amount,
[nft]: 1
})
});

Expand All @@ -51,8 +51,8 @@ Tester.prototype.testSwapNFT = async function (
tokenBuy: token,
amount: 1,
ratio: utils.weiRatio({
token: amount,
nft: 1
[token]: amount,
[nft]: 1
})
});

Expand Down Expand Up @@ -86,8 +86,8 @@ Tester.prototype.testSwap = async function (
tokenBuy: tokenB,
amount,
ratio: utils.weiRatio({
tokenA: 1,
tokenB: 2
[tokenA]: 1,
[tokenB]: 2
})
});

Expand All @@ -96,8 +96,8 @@ Tester.prototype.testSwap = async function (
tokenBuy: tokenA,
amount: amount.mul(2),
ratio: utils.weiRatio({
tokenA: 1,
tokenB: 2
[tokenA]: 1,
[tokenB]: 2
})
});

Expand Down Expand Up @@ -149,17 +149,17 @@ Tester.prototype.testSwapBatch = async function (
tokenSell: tokenA,
tokenBuy: tokenB,
ratio: utils.weiRatio({
tokenA: 2,
tokenB: 5
[tokenA]: 2,
[tokenB]: 5
})
});

const orderB = await walletB.getLimitOrder({
tokenSell: tokenB,
tokenBuy: tokenA,
ratio: utils.weiRatio({
tokenA: 1,
tokenB: 4
[tokenA]: 1,
[tokenB]: 4
})
});

Expand Down
2 changes: 1 addition & 1 deletion sdk/zksync.js/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export class Wallet {
const buy = order.tokenBuy;

if (!order.ratio[sell] || !order.ratio[buy]) {
throw new Error('Wrong tokens in the ratio object');
throw new Error(`Wrong tokens in the ratio object: should be ${sell} and ${buy}`);
}

if (order.ratio.type == 'Wei') {
Expand Down

0 comments on commit 2ba4a9b

Please sign in to comment.