Skip to content

Commit

Permalink
fix: LN tests
Browse files Browse the repository at this point in the history
  • Loading branch information
limpbrains committed Dec 5, 2023
1 parent a9b0db7 commit e996a3e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ jobs:
env:
HUSKY: 0

- name: Replace react-native-ldk with v0.0.121
run: yarn add @synonymdev/[email protected]

- name: Cache Pods
uses: actions/cache@v3
id: podcache
Expand Down Expand Up @@ -111,7 +108,6 @@ jobs:
run: |
cd docker && docker-compose down -t 60 && docker-compose up -d && cd ..
while ! nc -z '127.0.0.1' 60001; do sleep 1; done
- name: Test attempt 4
id: test4
if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success'
Expand Down
5 changes: 4 additions & 1 deletion e2e/lightning.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ d('Lightning', () => {
// - close channel

// FIXME: disable this test on CI until we figure out how to run new LDK
it.skip('Can receive and send LN payments', async () => {
it('Can receive and send LN payments', async () => {
if (checkComplete('lighting-1')) {
return;
}
Expand Down Expand Up @@ -188,6 +188,9 @@ d('Lightning', () => {
by.id('ReceiveLightningInvoice'),
).getAttributes();
await lnd.sendPaymentSync({ paymentRequest: invoice2 });
await waitFor(element(by.id('NewTxPrompt')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await waitFor(
element(by.id('MoneyPrimary').withAncestor(by.id('TotalBalance'))),
Expand Down
2 changes: 1 addition & 1 deletion e2e/lnurl.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ d('LNURL', () => {
});

// FIXME: disable this test on CI until we figure out how to run new LDK
it.skip('Can process lnurl channel, withdraw, pay and login requests', async () => {
it('Can process lnurl channel, withdraw, pay and login requests', async () => {
// Test plan:
// - connect to LND node`with lnurl-channel
// - test lnurl-pay
Expand Down
8 changes: 3 additions & 5 deletions src/utils/lightning/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export const setupLdk = async ({
serverPubKey: __BACKUPS_SERVER_PUBKEY__,
},
rapidGossipSyncUrl,
skipParamCheck: true, //Switch off for debugging LDK networking issues
skipParamCheck: false, //Switch off for debugging LDK networking issues
});

if (lmStart.isErr()) {
Expand Down Expand Up @@ -419,7 +419,6 @@ export const subscribeToLightningPayments = ({
selectedNetwork?: TAvailableNetworks;
}): void => {
if (!paymentSubscription) {
// @ts-ignore
paymentSubscription = ldk.onEvent(
EEventTypes.channel_manager_payment_claimed,
(res: TChannelManagerClaim) => {
Expand All @@ -439,7 +438,6 @@ export const subscribeToLightningPayments = ({
);
}
if (!onChannelSubscription) {
// @ts-ignore
onChannelSubscription = ldk.onEvent(
EEventTypes.new_channel,
async (_res: TChannelUpdate) => {
Expand All @@ -460,7 +458,6 @@ export const subscribeToLightningPayments = ({
);
}
if (!onSpendableOutputsSubscription) {
// @ts-ignore
onSpendableOutputsSubscription = ldk.onEvent(
EEventTypes.channel_manager_spendable_outputs,
() => {},
Expand Down Expand Up @@ -555,10 +552,11 @@ export const refreshLdk = async ({

await Promise.all([
updateLightningChannels({ selectedWallet, selectedNetwork }),
updateClaimableBalance({ selectedNetwork, selectedWallet }),
syncLightningTxsWithActivityList(),
]);

await updateClaimableBalance({ selectedNetwork, selectedWallet });

const accountVersion = getLightningStore()?.accountVersion;
if (!accountVersion || accountVersion < 2) {
// Attempt to migrate on refresh.
Expand Down

0 comments on commit e996a3e

Please sign in to comment.