Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,68 +56,52 @@ describe('api/any/conversion-fee-proxy-contract', () => {
jest.clearAllMocks();
});

it('can createExtensionsDataForCreation (Rinkeby)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'rinkeby',
maxRateTimespan: 1000,
});

expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: undefined,
feeAmount: undefined,
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'rinkeby',
maxRateTimespan: 1000,
});
});
const testSuite = (network: string) => {
it(`can createExtensionsDataForCreation on ${network}`, async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: network,
maxRateTimespan: 1000,
});

it('can createExtensionsDataForCreation (Goerli)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'goerli',
maxRateTimespan: 1000,
expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: undefined,
feeAmount: undefined,
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: network,
maxRateTimespan: 1000,
});
});

expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: undefined,
feeAmount: undefined,
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'goerli',
maxRateTimespan: 1000,
});
});
it(`can createExtensionsDataForCreation with fee amount and address ${network}`, async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
feeAddress: 'fee address',
feeAmount: '2000',
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: network,
});

it('can createExtensionsDataForCreation with fee amount and address (Rinkeby)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
feeAddress: 'fee address',
feeAmount: '2000',
paymentAddress: 'ethereum address',
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'rinkeby',
expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: 'fee address',
feeAmount: '2000',
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: network,
});
});
};

expect(createCreationAction).toHaveBeenCalledWith({
feeAddress: 'fee address',
feeAmount: '2000',
paymentAddress: 'ethereum address',
refundAddress: undefined,
salt: 'ea3bc7caf64110ca',
acceptedTokens: ['ethereum address2'],
network: 'rinkeby',
});
});
testSuite('rinkeby');
testSuite('goerli');

it('can createExtensionsDataForCreation with fee amount and address (Goerli)', async () => {
await anyToErc20Proxy.createExtensionsDataForCreation({
Expand Down
Loading