Skip to content

Commit bba13db

Browse files
committed
update: app to support latest RGB LN Node (commit 358d2d2)
1 parent 0ad7523 commit bba13db

File tree

129 files changed

+4782
-3677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+4782
-3677
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.2.0
2+
current_version = 0.3.0
33
commit = False
44
tag = False
55
allow_dirty = True

.github/actions/build-rln-node/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212

1313
- name: Install Rust
1414
run: |
15-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.81.0
15+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
1616
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
1717
source "$HOME/.cargo/env"
1818
shell: bash

.github/actions/publish-test-reports/action.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ runs:
3939
shell: bash
4040

4141
- name: Generate reports
42-
run: ./.github/scripts/generate-reports.sh
4342
shell: bash
43+
env:
44+
RUN_ID: ${{ github.run_id }}
45+
COMMIT_SHA: ${{ github.sha }}
46+
run: ./.github/scripts/generate-reports.sh
4447

45-
- name: Deploy to GitHub Pages
46-
uses: peaceiris/actions-gh-pages@v4
48+
- name: Upload Pages artifact
49+
uses: actions/upload-pages-artifact@v3
4750
with:
48-
github_token: ${{ github.token }}
49-
publish_dir: gh-pages
51+
path: site
52+
53+
- name: Deploy to GitHub Pages
54+
uses: actions/deploy-pages@v4

.github/scripts/generate-reports.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33

44
set -euo pipefail
55

6-
mkdir -p gh-pages
6+
mkdir -p site
77

88
# Generate embedded report
99
if [ -d "allure-results-embedded" ] && [ "$(ls -A allure-results-embedded 2>/dev/null)" ]; then
10-
allure generate allure-results-embedded --clean -o gh-pages/embedded
10+
allure generate allure-results-embedded --clean -o site/embedded
1111
else
12-
mkdir -p gh-pages/embedded
13-
echo "<h1>No embedded test results available</h1>" > gh-pages/embedded/index.html
12+
mkdir -p site/embedded
13+
echo "<h1>No embedded test results available</h1>" > site/embedded/index.html
1414
fi
1515

1616
# Generate remote report
1717
if [ -d "allure-results-remote" ] && [ "$(ls -A allure-results-remote 2>/dev/null)" ]; then
18-
allure generate allure-results-remote --clean -o gh-pages/remote
18+
allure generate allure-results-remote --clean -o site/remote
1919
else
20-
mkdir -p gh-pages/remote
21-
echo "<h1>No remote test results available</h1>" > gh-pages/remote/index.html
20+
mkdir -p site/remote
21+
echo "<h1>No remote test results available</h1>" > site/remote/index.html
2222
fi
2323

2424
# Copy coverage report
2525
if [ -d "coverage-report" ] && [ "$(ls -A coverage-report 2>/dev/null)" ]; then
26-
cp -r coverage-report gh-pages/coverage
26+
cp -r coverage-report site/coverage
2727
else
28-
mkdir -p gh-pages/coverage
29-
echo "<h1>No coverage report available</h1>" > gh-pages/coverage/index.html
28+
mkdir -p site/coverage
29+
echo "<h1>No coverage report available</h1>" > site/coverage/index.html
3030
fi
3131

3232
# Create index page with links to all reports
33-
cp .github/pages/allure-index.html gh-pages/index.html
33+
cp .github/pages/allure-index.html site/index.html
3434

3535
echo "✅ Reports generated successfully"

.github/workflows/tests.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,16 @@ jobs:
146146
- test_ask_auth_for_imp_operations
147147
- test_settings
148148
- test_btc_channel_tx
149-
- test_rgb20_channel_tx
149+
- test_nia_channel_tx
150150
- test_help
151151
- test_about
152152
- test_backup_and_restore
153-
- test_send_and_receive_rgb20_asset
154-
- test_send_and_receive_rgb25_asset
153+
- test_send_and_receive_nia_asset
154+
- test_send_and_receive_cfa_asset
155155
- test_hide_exhausted_asset
156156
- test_fail_transfer
157-
- test_issue_rgb20_asset
158-
- test_issue_rgb25_asset
157+
- test_issue_nia_asset
158+
- test_issue_cfa_asset
159159
- test_view_unspent
160160
- test_refresh_transfer
161161
env:
@@ -270,8 +270,12 @@ jobs:
270270
runs-on: ubuntu-latest
271271
if: always()
272272
permissions:
273-
contents: write
274-
actions: write
273+
contents: read
274+
pages: write
275+
id-token: write
276+
277+
environment:
278+
name: github-pages
275279

276280
steps:
277281
- name: Checkout repository

accessible_constant.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@
6565
SEND_ASSET_BUTTON = 'send_asset_button'
6666
ASSET_ADDRESS_VALIDATION_LABEL = 'asset_address_validation_label'
6767

68-
# Issue RGB20 asset page
69-
ISSUE_RGB20_ASSET = 'issue_rgb20_asset'
70-
ISSUE_RGB20_ASSET_CLOSE_BUTTON = 'issue_rgb20_asset_close_button'
71-
RGB20_ASSET_TICKER = 'rgb20_asset_ticker'
72-
RGB20_ASSET_NAME = 'rgb20_asset_name'
73-
RGB20_ASSET_AMOUNT = 'rgb20_asset_amount'
74-
ISSUE_RGB20_BUTTON = 'issue_rgb20_button'
68+
# Issue NIA asset page
69+
ISSUE_NIA_ASSET = 'issue_nia_asset'
70+
ISSUE_NIA_ASSET_CLOSE_BUTTON = 'issue_nia_asset_close_button'
71+
NIA_ASSET_TICKER = 'nia_asset_ticker'
72+
NIA_ASSET_NAME = 'nia_asset_name'
73+
NIA_ASSET_AMOUNT = 'nia_asset_amount'
74+
ISSUE_NIA_BUTTON = 'issue_nia_button'
7575

7676
# Success page
7777
SUCCESS_PAGE_CLOSE_BUTTON = 'success_page_close_button'
@@ -95,14 +95,14 @@
9595
VIEW_UNSPENT_LIST_BUTTON = 'view_unspent_list_button'
9696
SETTINGS_BUTTON = 'settings_button'
9797

98-
# Issue RGB25 asset page
99-
ISSUE_RGB25_ASSET = 'issue_rgb25_asset'
100-
ISSUE_RGB25_BUTTON = 'issue_rgb25_button'
101-
RGB25_ASSET_DESCRIPTION = 'rgb25_asset_description'
102-
RGB25_ASSET_NAME = 'rgb25_asset_name'
103-
RGB25_ASSET_AMOUNT = 'rgb25_asset_amount'
104-
RGB25_UPLOAD_FILE_BUTTON = 'rgb25_upload_file_button'
105-
ISSUE_RGB25_ASSET_CLOSE_BUTTON = 'issue_rgb25_asset_close_button'
98+
# Issue CFA asset page
99+
ISSUE_CFA_ASSET = 'issue_cfa_asset'
100+
ISSUE_CFA_BUTTON = 'issue_cfa_button'
101+
CFA_ASSET_DESCRIPTION = 'cfa_asset_description'
102+
CFA_ASSET_NAME = 'cfa_asset_name'
103+
CFA_ASSET_AMOUNT = 'cfa_asset_amount'
104+
CFA_UPLOAD_FILE_BUTTON = 'cfa_upload_file_button'
105+
ISSUE_CFA_ASSET_CLOSE_BUTTON = 'issue_cfa_asset_close_button'
106106

107107
# File chooser
108108
FILE_CHOOSER = 'file chooser'

e2e_tests/compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
bitcoind:
3-
image: registry.gitlab.com/hashbeam/docker/bitcoind:28.1
3+
image: registry.gitlab.com/hashbeam/docker/bitcoind:30.0
44
command: "-fallbackfee=0.0002"
55
environment:
66
MYUID: 1000
@@ -11,7 +11,7 @@ services:
1111
volumes:
1212
- ./datacore:/srv/app/.bitcoin
1313
electrs:
14-
image: registry.gitlab.com/hashbeam/docker/electrs:0.10.9
14+
image: registry.gitlab.com/hashbeam/docker/electrs:0.10.10
1515
environment:
1616
MYUID: 1000
1717
MYGID: 1000

e2e_tests/conftest.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
"""
55
from __future__ import annotations
66

7+
import io
78
import os
89
import subprocess
910
import time
1011

12+
import allure
1113
import pytest
1214
from dogtail.tree import root
15+
from PIL import Image
16+
from Xlib import display
17+
from Xlib import X
1318

1419
from accessible_constant import DEFAULT_WALLET_MODES
1520
from src.model.enums.enums_model import WalletType
@@ -132,6 +137,82 @@ def pytest_runtest_logreport(report):
132137
_print_test_result('⏭️', 'SKIPPED', test_name)
133138

134139

140+
def _capture_screenshot():
141+
"""
142+
Capture a screenshot of the entire screen using Xlib.
143+
144+
Returns:
145+
bytes: PNG image data, or None if capture fails
146+
"""
147+
try:
148+
# Get the display and screen
149+
dpy = display.Display()
150+
screen = dpy.screen()
151+
root_window = screen.root
152+
153+
# Get screen dimensions
154+
width = screen.width_in_pixels
155+
height = screen.height_in_pixels
156+
157+
# Capture the screen
158+
raw_image = root_window.get_image(
159+
0, 0, width, height, X.ZPixmap, 0xffffffff,
160+
)
161+
162+
# Convert to PIL Image
163+
image = Image.frombytes(
164+
'RGB',
165+
(width, height),
166+
raw_image.data,
167+
'raw',
168+
'BGRX',
169+
)
170+
171+
# Save to bytes buffer
172+
buffer = io.BytesIO()
173+
image.save(buffer, format='PNG')
174+
buffer.seek(0)
175+
176+
return buffer.getvalue()
177+
except Exception as e:
178+
print(f"[SCREENSHOT] Failed to capture screenshot: {e}")
179+
return None
180+
181+
182+
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
183+
def pytest_runtest_makereport(item):
184+
"""
185+
Pytest hook to capture screenshots on test failure and attach to Allure report.
186+
187+
This hook runs after each test phase (setup, call, teardown) and captures
188+
a screenshot if the test failed during the 'call' phase.
189+
"""
190+
# Execute all other hooks to obtain the report object
191+
outcome = yield
192+
report = outcome.get_result()
193+
194+
# Only capture screenshot on test failure during the 'call' phase
195+
if report.when == 'call' and report.failed:
196+
try:
197+
screenshot_bytes = _capture_screenshot()
198+
199+
if screenshot_bytes:
200+
# Attach screenshot to Allure report
201+
allure.attach(
202+
screenshot_bytes,
203+
name='failure_screenshot',
204+
attachment_type=allure.attachment_type.PNG,
205+
)
206+
print(f"""[SCREENSHOT] ✅ Screenshot captured and attached for failed test:
207+
{item.nodeid}""")
208+
else:
209+
print(f"""[SCREENSHOT] ⚠️ Failed to capture screenshot for:
210+
{item.nodeid}""")
211+
except Exception as e:
212+
print(f"""[SCREENSHOT] ❌ Error capturing screenshot for
213+
{item.nodeid}: {e}""")
214+
215+
135216
def _is_ci_environment():
136217
"""Check if running in CI environment."""
137218
return os.getenv('CI', '').lower() in ('true', '1', 'yes')

e2e_tests/test/features/channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pylint:disable=too-many-branches
22
"""
3-
This module contains the IssueRgb20 class, which provides methods for issuing RGB20 assets.
3+
This module contains the Channel class, which provides methods for channel operations.
44
"""
55
from __future__ import annotations
66

@@ -144,7 +144,7 @@ def get_node_uri_for_embedded(self, application, ip_address):
144144
if self.do_is_displayed(self.sidebar_page_objects.fungibles_button()):
145145
self.sidebar_page_objects.click_fungibles_button()
146146

147-
embedded_node_uri = f"{node_pubkey}@{ip_address}:{ln_port}"
147+
embedded_node_uri = f'{node_pubkey}@{ip_address}:{ln_port}'
148148

149149
return embedded_node_uri
150150

@@ -163,6 +163,6 @@ def get_node_uri_for_remote(self, application, ip_address, ln_port):
163163
if self.do_is_displayed(self.sidebar_page_objects.fungibles_button()):
164164
self.sidebar_page_objects.click_fungibles_button()
165165

166-
remote_node_uri = f"{node_pubkey}@{ip_address}:{ln_port}"
166+
remote_node_uri = f'{node_pubkey}@{ip_address}:{ln_port}'
167167

168168
return remote_node_uri

0 commit comments

Comments
 (0)