Skip to content

Commit

Permalink
update mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Sep 9, 2022
1 parent ceac6bf commit c1b61cc
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/SmartTransactionsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ import { SmartTransaction, SmartTransactionStatuses } from './types';

const confirmExternalMock = jest.fn();

jest.mock('ethers', () => ({
ethers: {
providers: {
Web3Provider: class Web3Provider {
getBalance = () => ({ toHexString: () => '0x1000' });
jest.mock('@ethersproject/bytes', () => ({
hexlify: (str: string) => `0x${str}`,
}));

getTransactionReceipt = jest.fn(() => ({ blockNumber: '123' }));
jest.mock('@ethersproject/providers', () => ({
Web3Provider: class Web3Provider {
getBalance = () => ({ toHexString: () => '0x1000' });

getTransaction = jest.fn(() => ({
maxFeePerGas: { toHexString: () => '0x123' },
maxPriorityFeePerGas: { toHexString: () => '0x123' },
}));
getTransactionReceipt = jest.fn(() => ({ blockNumber: '123' }));

getBlock = jest.fn();
},
},
utils: {
hexlify: (str: string) => `0x${str}`,
},
BigNumber: class BigNumber {},
getTransaction = jest.fn(() => ({
maxFeePerGas: { toHexString: () => '0x123' },
maxPriorityFeePerGas: { toHexString: () => '0x123' },
}));

getBlock = jest.fn();
},
}));

jest.mock('@ethersproject/bignumber', () => ({
BigNumber: class BigNumber {},
}));

const addressFrom = '0x268392a24B6b093127E8581eAfbD1DA228bAdAe3';

const createUnsignedTransaction = () => {
Expand Down

0 comments on commit c1b61cc

Please sign in to comment.