Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avkos committed Sep 18, 2024
1 parent 2965d00 commit b4daf3e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 9 additions & 3 deletions test/integration/wallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ describe('Wallet', () => {
to: ADDRESS2,
value: web3Utils.toHex(7_000_000_000),
});
console.log('result', result);
deepEqualExcluding(result, tx, [
'gasLimit',
'gasPrice',
Expand All @@ -232,9 +233,9 @@ describe('Wallet', () => {
]);
expect(toBigInt(result.gasLimit) > 0n).toEqual(true);
expect(
toBigInt(result.maxPriorityFeePerGas) > 0n ||
toBigInt(result.maxFeePerGas) > 0n ||
toBigInt(result.gasPrice) > 0n,
(result.maxPriorityFeePerGas && toBigInt(result.maxPriorityFeePerGas) > 0n) ||
(result.maxFeePerGas && toBigInt(result.maxFeePerGas) > 0n) ||
(result.gasPrice && toBigInt(result.gasPrice) > 0n),
).toEqual(true);
});
it('should return a populated transaction with default values if are omitted', async () => {
Expand Down Expand Up @@ -1311,6 +1312,11 @@ describe('Wallet', () => {
const l2BalanceAfterExecution = await wallet.getBalance();
const l1BalanceAfterExecution = await wallet.getBalanceL1();
expect(result).not.toBeNull();
console.log({
l2BalanceAfterExecution,
l2BalanceBeforeExecution,
amount,
});
expect(l2BalanceAfterExecution - l2BalanceBeforeExecution >= amount).toEqual(true);
expect(l1BalanceBeforeExecution - l1BalanceAfterExecution >= amount).toEqual(true);
});
Expand Down
2 changes: 0 additions & 2 deletions test/local/account-abstraction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ describe('Account Abstraction', () => {
const PRIVATE_KEY1 = accounts[0].privateKey;
const ADDRESS1 = accounts[0].address;
const wallet = new ZKsyncWallet(PRIVATE_KEY1, l2Provider);
const acc = l2Provider.eth.accounts.privateKeyToAccount(PRIVATE_KEY1);
l2Provider.eth.accounts.wallet.add(acc);
it('use the ERC20 token for paying transaction fee', async () => {
const InitMintAmount = 10n;
const mintAmount = 3n;
Expand Down
3 changes: 0 additions & 3 deletions test/local/deposit-withdraw.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Web3ZKsyncL2, Web3ZKsyncL1, ZKsyncWallet } from '../../src';
import { ETH_ADDRESS } from '../../src/constants';
import * as utils from '../../src/utils';
import { getAccounts } from './fixtures';
import { L1_CHAIN_URL, L2_CHAIN_URL } from '../utils';

Expand All @@ -11,8 +10,6 @@ import { L1_CHAIN_URL, L2_CHAIN_URL } from '../utils';

jest.setTimeout(60000);
describe('wallet', () => {
// @ts-ignore
TransactionFactory.registerTransactionType(EIP712_TX_TYPE, utils.EIP712Transaction);
const l1Provider = new Web3ZKsyncL1(L1_CHAIN_URL);
const accounts = getAccounts();
const l2Provider = new Web3ZKsyncL2(L2_CHAIN_URL);
Expand Down

0 comments on commit b4daf3e

Please sign in to comment.