@@ -72,26 +72,12 @@ export function registerPaymentDelegationTicketSuite() {
7272 userMaxPrice : 1000000000000000000n , // 0.05 ETH in Wei
7373 } ) ;
7474
75- // 4. Finally, check that Alice's Ledger balance has decreased
76- const aliceBalanceAfter = await testEnv . masterPaymentManager . getBalance ( {
77- userAddress : alice . account . address ,
78- } ) ;
79-
80- console . log (
81- "[AFTER] Alice's Ledger balance after Bob's request:" ,
82- aliceBalanceAfter
83- ) ;
84-
85- expect ( BigInt ( aliceBalanceAfter . raw . availableBalance ) ) . toBeLessThan (
86- BigInt ( aliceBeforeBalance . raw . availableBalance )
87- ) ;
88-
89- // 5. Now, Alice removes Bob from her sponsorship
75+ // 4. Now, Alice removes Bob from her sponsorship
9076 await alice . paymentManager ! . undelegatePaymentsBatch ( {
9177 userAddresses : [ bobAccount . account . address ] ,
9278 } ) ;
9379
94- // 6 . Bob should now fail to sign with his PKP due to lack of sponsorship
80+ // 5 . Bob should now fail to sign with his PKP due to lack of sponsorship
9581 let didFail = false ;
9682 try {
9783 await testEnv . litClient . chain . ethereum . pkpSign ( {
@@ -109,6 +95,20 @@ export function registerPaymentDelegationTicketSuite() {
10995 }
11096
11197 expect ( didFail ) . toBe ( true ) ;
98+
99+ // 6. Finally, check that Alice's Ledger balance has decreased
100+ const aliceBalanceAfter = await testEnv . masterPaymentManager . getBalance ( {
101+ userAddress : alice . account . address ,
102+ } ) ;
103+
104+ console . log (
105+ "[AFTER] Alice's Ledger balance after Bob's request:" ,
106+ aliceBalanceAfter
107+ ) ;
108+
109+ expect ( BigInt ( aliceBalanceAfter . raw . availableBalance ) ) . toBeLessThan (
110+ BigInt ( aliceBeforeBalance . raw . availableBalance )
111+ ) ;
112112 } ) ;
113113 } ) ;
114114}
0 commit comments