From 2ba4a9b77c72d5991450c288d8601624a97a139a Mon Sep 17 00:00:00 2001 From: Lyova Potyomkin Date: Tue, 25 May 2021 17:32:50 +0300 Subject: [PATCH] Fix tests --- core/tests/ts-tests/tests/swap.ts | 24 ++++++++++++------------ sdk/zksync.js/src/wallet.ts | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/tests/ts-tests/tests/swap.ts b/core/tests/ts-tests/tests/swap.ts index 673ed8f068..26331fcbf8 100644 --- a/core/tests/ts-tests/tests/swap.ts +++ b/core/tests/ts-tests/tests/swap.ts @@ -41,8 +41,8 @@ Tester.prototype.testSwapNFT = async function ( tokenBuy: nft, amount, ratio: utils.weiRatio({ - token: amount, - nft: 1 + [token]: amount, + [nft]: 1 }) }); @@ -51,8 +51,8 @@ Tester.prototype.testSwapNFT = async function ( tokenBuy: token, amount: 1, ratio: utils.weiRatio({ - token: amount, - nft: 1 + [token]: amount, + [nft]: 1 }) }); @@ -86,8 +86,8 @@ Tester.prototype.testSwap = async function ( tokenBuy: tokenB, amount, ratio: utils.weiRatio({ - tokenA: 1, - tokenB: 2 + [tokenA]: 1, + [tokenB]: 2 }) }); @@ -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 }) }); @@ -149,8 +149,8 @@ Tester.prototype.testSwapBatch = async function ( tokenSell: tokenA, tokenBuy: tokenB, ratio: utils.weiRatio({ - tokenA: 2, - tokenB: 5 + [tokenA]: 2, + [tokenB]: 5 }) }); @@ -158,8 +158,8 @@ Tester.prototype.testSwapBatch = async function ( tokenSell: tokenB, tokenBuy: tokenA, ratio: utils.weiRatio({ - tokenA: 1, - tokenB: 4 + [tokenA]: 1, + [tokenB]: 4 }) }); diff --git a/sdk/zksync.js/src/wallet.ts b/sdk/zksync.js/src/wallet.ts index 849fc4afc9..6aaaec68ed 100644 --- a/sdk/zksync.js/src/wallet.ts +++ b/sdk/zksync.js/src/wallet.ts @@ -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') {