Skip to content

Commit

Permalink
fixing eth-input-data tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KolevDarko committed Mar 10, 2022
1 parent 223d728 commit 9941cd4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Expand Up @@ -35,18 +35,18 @@ describe('ETH Fee proxy detection test-suite', () => {
const balance = await ethInputContract.getBalance({
...requestData,
currency: {
network: 'private',
network: 'rinkeby',
type: RequestLogicTypes.CURRENCY.ETH,
value: privateErc20Address,
},
});

expect(balance.error).toBeUndefined();
expect(balance.balance).toBe('50000000000000000');
expect(balance.events).toHaveLength(1);
expect(balance.events[0].name).toBe('payment');
expect(balance.events[0].amount).toBe('1');
expect(balance.events[0].amount).toBe('50000000000000000');
expect(Math.abs(declarationTimestamp - (balance.events[0].timestamp ?? 0))).toBeLessThan(5);
});
}, 20000);

it('getBalance = 0 if the payer declared the payment', async () => {
// Create a request
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-test/test/scheduled/fixtures.ts
Expand Up @@ -43,7 +43,7 @@ export const erc20requestCreationHash: Types.IRequestInfo = {

export const ethInputDataCreationHash: Types.IRequestInfo = {
currency: {
network: 'private',
network: 'rinkeby',
type: Types.RequestLogic.CURRENCY.ETH,
value: privateErc20Address, // TODO: Change to ETH address
},
Expand Down
16 changes: 16 additions & 0 deletions packages/integration-test/test/scheduled/mocks.ts
Expand Up @@ -36,5 +36,21 @@ export const mockAdvancedLogic: AdvancedLogicTypes.IAdvancedLogic = {
createAddPaymentInstructionAction,
createAddRefundInstructionAction,
},
feeProxyContractEth: {
supportedNetworks: ['rinkeby', 'private'],
createAddPaymentAddressAction,
createAddRefundAddressAction,
createCreationAction,
createAddPaymentInstructionAction,
createAddRefundInstructionAction,
},
ethereumInputData: {
supportedNetworks: ['rinkeby', 'private'],
createAddPaymentAddressAction,
createAddRefundAddressAction,
createCreationAction,
createAddPaymentInstructionAction,
createAddRefundInstructionAction,
},
},
};

0 comments on commit 9941cd4

Please sign in to comment.