Skip to content

Commit a5a805f

Browse files
authored
Merge pull request #72 from synonymdev/fix/lnurl-min-send-ceil
Verify lnurl amt rounding min/max edges
2 parents 8ad57d7 + 1875174 commit a5a805f

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

test/helpers/actions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ export async function acceptAppNotificationAlert(
435435
export async function doNavigationClose() {
436436
await tap('HeaderMenu');
437437
await tap('DrawerWallet');
438+
await sleep(500);
438439
}
439440

440441
export async function getSeed(): Promise<string> {
@@ -671,6 +672,8 @@ export async function receiveOnchainFunds(
671672
}
672673

673674
export type ToastId =
675+
| 'BoostSuccessToast'
676+
| 'BoostFailureToast'
674677
| 'LnurlPayAmountTooLowToast'
675678
| 'SpendingBalanceReadyToast'
676679
| 'BalanceUnitSwitchedToast'

test/specs/boost.e2e.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
waitForBackup,
1919
restoreWallet,
2020
enterAddress,
21+
waitForToast,
2122
} from '../helpers/actions';
2223
import { bitcoinURL } from '../helpers/constants';
2324
import initElectrum from '../helpers/electrum';
@@ -74,6 +75,7 @@ describe('@boost - Boost', () => {
7475
await tap('Minus');
7576
await tap('RecommendedFeeButton');
7677
await dragOnElement('GRAB', 'right', 0.95); // Swipe to confirm
78+
await waitForToast('BoostSuccessToast');
7779

7880
// check Activity
7981
await elementById('BoostingIcon').waitForDisplayed();
@@ -189,7 +191,8 @@ describe('@boost - Boost', () => {
189191
await tap('Minus');
190192
await tap('RecommendedFeeButton');
191193
await dragOnElement('GRAB', 'right', 0.95); // Swipe to confirm
192-
194+
await waitForToast('BoostSuccessToast');
195+
193196
// check Activity
194197
await elementById('BoostingIcon').waitForDisplayed();
195198
await elementById('ActivityShort-0').waitForDisplayed();

test/specs/lnurl.e2e.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,32 +151,31 @@ describe('@lnurl - LNURL', () => {
151151
await expectTextWithin('ActivitySpending', '20 001');
152152

153153
// lnurl-pay (min != max) with comment
154-
const msats = 100000; // msats
155-
const sats = (msats / 1000).toString();
156154
const payRequest1 = await lnurlServer.generateNewUrl('payRequest', {
157-
minSendable: msats, // msats
158-
maxSendable: 200000, // msats
155+
minSendable: 149500, // msats
156+
maxSendable: 200999, // msats
159157
metadata: '[["text/plain","lnurl-node1"]]',
160158
commentAllowed: 12,
161159
});
162160
console.log('payRequest1', payRequest1);
163161

164162
await enterAddressViaScanPrompt(payRequest1.encoded, { acceptCameraPermission: false });
165163
await expectTextWithin('SendNumberField', '0');
166-
// Check amounts 99 - 201 not allowed
164+
// Check that 149 sats is below minimum and 201 sats is above maximum (both rejected)
167165
await tap('N2');
168166
await tap('N0');
169167
await tap('N1');
170168
await expectTextWithin('SendNumberField', '201');
171169
await elementById('ContinueAmount').waitForEnabled({ reverse: true });
172170
await multiTap('NRemove', 3); // remove "201"
173-
await multiTap('N9', 2);
174-
175-
await expectTextWithin('SendNumberField', '99');
171+
await tap('N1');
172+
await tap('N4');
173+
await tap('N9');
174+
await expectTextWithin('SendNumberField', '149');
176175
await tap('ContinueAmount');
177176
await waitForToast('LnurlPayAmountTooLowToast');
178177

179-
await multiTap('NRemove', 2); // remove "99"
178+
await multiTap('NRemove', 3); // remove "149"
180179
// go with 150
181180
await tap('N1');
182181
await tap('N5');

0 commit comments

Comments
 (0)