Skip to content

Commit 49623f1

Browse files
committed
fix(e2e): update comments for clarity in payment delegation tests
1 parent d65da5d commit 49623f1

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

packages/e2e/src/e2e.spec.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,12 @@ describe('all', () => {
172172

173173
it('eoaNativeAuthFlow', () => createEoaNativeAuthFlowTest(ctx)());
174174
});
175-
176-
if (process.env['NETWORK'] !== 'naga-dev') {
177-
describe('paid networks only', () => {
178-
registerPaymentDelegationTicketSuite();
179-
});
180-
}
181175
});
182176
});
177+
178+
// ====== These tests only run on paid networks ======
179+
if (process.env['NETWORK'] !== 'naga-dev') {
180+
describe('Paid networks tests', () => {
181+
registerPaymentDelegationTicketSuite();
182+
});
183+
}

packages/e2e/src/tickets/delegation.suite.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,20 @@ export function registerPaymentDelegationTicketSuite() {
6464
aliceBeforeBalance
6565
);
6666

67-
// 3. Now, Bob tries to sign with his PKP using Alice's sponsorship
67+
// 4. Now, Bob tries to sign with his PKP using Alice's sponsorship
6868
await testEnv.litClient.chain.ethereum.pkpSign({
6969
authContext: bobAccount.eoaAuthContext!,
7070
pubKey: bobAccount.pkp?.pubkey!,
7171
toSign: 'Hello, world!',
7272
userMaxPrice: 1000000000000000000n, // 0.05 ETH in Wei
7373
});
7474

75-
// 4. Now, Alice removes Bob from her sponsorship
75+
// 5. Now, Alice removes Bob from her sponsorship
7676
await alice.paymentManager!.undelegatePaymentsBatch({
7777
userAddresses: [bobAccount.account.address],
7878
});
7979

80-
// 5. Bob should now fail to sign with his PKP due to lack of sponsorship
80+
// 6. Bob should now fail to sign with his PKP due to lack of sponsorship
8181
let didFail = false;
8282
try {
8383
await testEnv.litClient.chain.ethereum.pkpSign({
@@ -96,7 +96,9 @@ export function registerPaymentDelegationTicketSuite() {
9696

9797
expect(didFail).toBe(true);
9898

99-
// 6. Finally, check that Alice's Ledger balance has decreased
99+
// 7. Finally, check that Alice's Ledger balance has decreased
100+
// let's wait a big longer for the payment to be processed
101+
await new Promise((resolve) => setTimeout(resolve, 5000));
100102
const aliceBalanceAfter = await testEnv.masterPaymentManager.getBalance({
101103
userAddress: alice.account.address,
102104
});

0 commit comments

Comments
 (0)