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 43448a8
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/SmartTransactionsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,27 @@ 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';

Expand Down

0 comments on commit 43448a8

Please sign in to comment.