Skip to content

Commit 9436290

Browse files
committed
Merge branch 'master' into fix/btach-conversion-capped
2 parents fb8d60c + 8ae22e1 commit 9436290

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

packages/payment-detection/src/thegraph/info-retriever.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class TheGraphInfoRetriever {
108108
'feeAmountInCrypto',
109109
'maxRateTimespan',
110110
),
111-
String,
111+
(val) => (val !== null ? String(val) : undefined),
112112
),
113113
// Make sure the checksum is right for addresses.
114114
...mapValues(pick(payment, 'from', 'feeAddress', 'tokenAddress'), (str, key) =>

packages/payment-detection/test/erc20/fee-proxy-contract.test.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,11 @@ describe('api/erc20/fee-proxy-contract', () => {
425425
txHash: '0x456d67cba236778e91a901e97c71684e82317dc2679d1b5c6bfa6d420d636b7d',
426426
gasUsed: '73152',
427427
gasPrice: '12709127644',
428+
timestamp: 1666002347,
429+
amountInCrypto: null,
430+
feeAddress: '0x35d0e078755cd84d3e0656caab417dee1d7939c7',
431+
feeAmountInCrypto: null,
432+
maxRateTimespan: null,
428433
},
429434
].filter((x) => x.reference.toLowerCase() === reference.toLowerCase()),
430435
escrowEvents: [],
@@ -434,8 +439,29 @@ describe('api/erc20/fee-proxy-contract', () => {
434439
}),
435440
});
436441

437-
const { balance, error } = await erc20FeeProxyContract.getBalance(mockRequest);
442+
const { balance, error, events } = await erc20FeeProxyContract.getBalance(mockRequest);
438443
expect(error).toBeUndefined();
439444
expect(balance).toBe('168040800000000000000000');
445+
expect(events).toMatchObject([
446+
{
447+
amount: '168040800000000000000000',
448+
name: 'payment',
449+
parameters: {
450+
amountInCrypto: undefined,
451+
block: 15767215,
452+
feeAddress: '0x35d0e078755Cd84D3E0656cAaB417Dee1d7939c7',
453+
feeAmount: '13386000000000000000',
454+
feeAmountInCrypto: undefined,
455+
from: '0x15339d48Fbe31E349A507FD6d48Eb01c45Fdc79A',
456+
gasPrice: '12709127644',
457+
gasUsed: '73152',
458+
maxRateTimespan: undefined,
459+
to: '0x6c9E04997000d6A8a353951231923d776d4Cdff2',
460+
tokenAddress: '0x967da4048cD07aB37855c090aAF366e4ce1b9F48',
461+
txHash: '0x456d67cba236778e91a901e97c71684e82317dc2679d1b5c6bfa6d420d636b7d',
462+
},
463+
timestamp: 1666002347,
464+
},
465+
]);
440466
});
441467
});

packages/payment-detection/test/near/near-native.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('Near payments detection', () => {
6464
expect(events).toHaveLength(1);
6565

6666
expect(events[0].amount).toBe('1000000000000000000000000');
67-
expect(events[0].timestamp).toBe(1631788427230);
67+
expect(events[0].timestamp).toBe(1631788427);
6868
expect(events[0].parameters?.receiptId).toBe('FYVnCvJFoNtK7LE2uAdTFfReFMGiCUHMczLsvEni1Cpf');
6969
expect(events[0].parameters?.txHash).toBeUndefined();
7070
expect(events[0].parameters?.block).toBe(47891257);

0 commit comments

Comments
 (0)