Skip to content

Commit 1292244

Browse files
committed
fix(tests): update function selectors for authorizePayment and chargePayment
- Corrected the expected function selectors in the tests for `authorizePayment` and `chargePayment` to reflect recent changes in the contract implementation. - Ensured that the tests validate the correct encoding of transaction data, maintaining accuracy in the test suite.
1 parent 8e557f8 commit 1292244

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/payment-processor/test/payment/erc20-commerce-escrow-wrapper.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ describe('erc20-commerce-escrow-wrapper', () => {
245245
expect(encodedData).toMatch(/^0x[a-fA-F0-9]+$/); // Should be valid hex string
246246

247247
// Verify it starts with the correct function selector for authorizePayment
248-
// Function signature: authorizePayment(bytes8,address,address,address,address,uint256,uint256,uint256,uint256,uint256,address,bytes)
249-
expect(encodedData.substring(0, 10)).toBe('0x5532a547'); // Actual function selector
248+
// Function signature: authorizePayment((bytes8,address,address,address,address,uint256,uint256,uint256,uint256,uint256,address,bytes))
249+
expect(encodedData.substring(0, 10)).toBe('0x03af28e0'); // Actual function selector
250250

251251
// Verify the encoded data contains our test parameters
252252
expect(encodedData.length).toBeGreaterThan(10); // More than just function selector
@@ -325,7 +325,7 @@ describe('erc20-commerce-escrow-wrapper', () => {
325325
expect(encodedData).toMatch(/^0x[a-fA-F0-9]+$/); // Should be valid hex string
326326

327327
// Verify it starts with the correct function selector for chargePayment
328-
expect(encodedData.substring(0, 10)).toBe('0x739802a3');
328+
expect(encodedData.substring(0, 10)).toBe('0x246b52d3');
329329

330330
// Verify the encoded data contains our test parameters
331331
expect(encodedData).toContain(mockChargeParams.paymentReference.substring(2));
@@ -955,7 +955,7 @@ describe('ERC20 Commerce Escrow Wrapper Integration', () => {
955955
provider,
956956
});
957957
expect(chargeData).toMatch(/^0x[a-fA-F0-9]+$/);
958-
expect(chargeData.substring(0, 10)).toBe('0x739802a3'); // chargePayment selector
958+
expect(chargeData.substring(0, 10)).toBe('0x246b52d3'); // chargePayment selector
959959
expect(chargeData.length).toBeGreaterThan(100); // Should be long due to many parameters
960960
});
961961

0 commit comments

Comments
 (0)