Skip to content

Commit 5e4b5b1

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

File tree

127 files changed

+4726
-3479
lines changed

Some content is hidden

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

127 files changed

+4726
-3479
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/workflows/tests.yml

Lines changed: 5 additions & 5 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:

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
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
"""
2+
Module for testing CFA asset issuance.
3+
"""
4+
from __future__ import annotations
5+
6+
import os
7+
8+
from e2e_tests.test.pageobjects.main_page_objects import MainPageObjects
9+
from e2e_tests.test.utilities.asset_copy import copy_cfa_image_to_home_directory
10+
from e2e_tests.test.utilities.base_operation import BaseOperations
11+
12+
13+
class IssueCfa(MainPageObjects, BaseOperations):
14+
"""
15+
Class for testing CFA asset issuance.
16+
"""
17+
18+
def __init__(self, application):
19+
"""
20+
Initialize the IssueCfa class.
21+
"""
22+
super().__init__(application)
23+
24+
def issue_cfa_with_sufficient_sats_and_utxo(self, application, asset_name, asset_description, asset_amount, is_native_auth_enabled: bool = False):
25+
"""
26+
Issue CFA asset with sufficient sats and utxo.
27+
"""
28+
self.do_focus_on_application(application)
29+
copy_cfa_image_to_home_directory(os.getcwd())
30+
31+
if self.do_is_displayed(self.sidebar_page_objects.collectibles_button()):
32+
self.sidebar_page_objects.click_collectibles_button()
33+
34+
if self.do_is_displayed(self.collectible_page_objects.issue_cfa_button()):
35+
self.collectible_page_objects.click_issue_cfa_button()
36+
37+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_name()):
38+
self.issue_cfa_page_objects.enter_asset_name(asset_name)
39+
40+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_description()):
41+
self.issue_cfa_page_objects.enter_asset_description(
42+
asset_description,
43+
)
44+
45+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_amount()):
46+
self.issue_cfa_page_objects.enter_asset_amount(asset_amount)
47+
48+
if self.do_is_displayed(self.issue_cfa_page_objects.upload_file_button()):
49+
self.issue_cfa_page_objects.click_upload_file_button()
50+
51+
if self.do_is_displayed(self.issue_cfa_page_objects.cfa_asset_media()):
52+
self.issue_cfa_page_objects.click_cfa_asset_media()
53+
54+
if self.do_is_displayed(self.issue_cfa_page_objects.issue_cfa_button()):
55+
self.issue_cfa_page_objects.click_issue_cfa_button()
56+
57+
if is_native_auth_enabled is True:
58+
self.enter_native_password()
59+
60+
if self.do_is_displayed(self.success_page_objects.home_button()):
61+
self.success_page_objects.click_home_button()
62+
63+
def issue_cfa_asset_without_sat(self, application, asset_name, asset_description, asset_amount):
64+
"""
65+
Issue CFA asset without sat.
66+
"""
67+
description = None
68+
self.do_focus_on_application(application)
69+
copy_cfa_image_to_home_directory(os.getcwd())
70+
71+
if self.do_is_displayed(self.sidebar_page_objects.collectibles_button()):
72+
self.sidebar_page_objects.click_collectibles_button()
73+
74+
if self.do_is_displayed(self.collectible_page_objects.issue_cfa_button()):
75+
self.collectible_page_objects.click_issue_cfa_button()
76+
77+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_name()):
78+
self.issue_cfa_page_objects.enter_asset_name(asset_name)
79+
80+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_description()):
81+
self.issue_cfa_page_objects.enter_asset_description(
82+
asset_description,
83+
)
84+
85+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_amount()):
86+
self.issue_cfa_page_objects.enter_asset_amount(asset_amount)
87+
88+
if self.do_is_displayed(self.issue_cfa_page_objects.upload_file_button()):
89+
self.issue_cfa_page_objects.click_upload_file_button()
90+
91+
if self.do_is_displayed(self.issue_cfa_page_objects.cfa_asset_media()):
92+
self.issue_cfa_page_objects.click_cfa_asset_media()
93+
94+
if self.do_is_displayed(self.issue_cfa_page_objects.issue_cfa_button()):
95+
self.issue_cfa_page_objects.click_issue_cfa_button()
96+
97+
if self.do_is_displayed(self.toaster_page_objects.toaster_frame()):
98+
description = self.toaster_page_objects.click_and_get_description()
99+
100+
if self.do_is_displayed(self.issue_cfa_page_objects.close_button()):
101+
self.issue_cfa_page_objects.click_close_button()
102+
103+
if self.do_is_displayed(self.sidebar_page_objects.fungibles_button()):
104+
self.sidebar_page_objects.click_fungibles_button()
105+
106+
return description
107+
108+
def issue_cfa_with_sufficient_sats_and_no_utxo(self, application, asset_name, asset_description, asset_amount):
109+
"""
110+
Issue CFA asset with sufficient sats and no utxo.
111+
"""
112+
self.do_focus_on_application(application)
113+
copy_cfa_image_to_home_directory(os.getcwd())
114+
115+
if self.do_is_displayed(self.sidebar_page_objects.view_unspents_button()):
116+
self.sidebar_page_objects.click_view_unspents_button()
117+
118+
if self.do_is_displayed(self.sidebar_page_objects.collectibles_button()):
119+
self.sidebar_page_objects.click_collectibles_button()
120+
121+
if self.do_is_displayed(self.collectible_page_objects.issue_cfa_button()):
122+
self.collectible_page_objects.click_issue_cfa_button()
123+
124+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_name()):
125+
self.issue_cfa_page_objects.enter_asset_name(asset_name)
126+
127+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_description()):
128+
self.issue_cfa_page_objects.enter_asset_description(
129+
asset_description,
130+
)
131+
132+
if self.do_is_displayed(self.issue_cfa_page_objects.asset_amount()):
133+
self.issue_cfa_page_objects.enter_asset_amount(asset_amount)
134+
135+
if self.do_is_displayed(self.issue_cfa_page_objects.upload_file_button()):
136+
self.issue_cfa_page_objects.click_upload_file_button()
137+
138+
if self.do_is_displayed(self.issue_cfa_page_objects.cfa_asset_media()):
139+
self.issue_cfa_page_objects.click_cfa_asset_media()
140+
141+
if self.do_is_displayed(self.issue_cfa_page_objects.issue_cfa_button()):
142+
self.issue_cfa_page_objects.click_issue_cfa_button()
143+
144+
if self.do_is_displayed(self.success_page_objects.home_button()):
145+
self.success_page_objects.click_home_button()

0 commit comments

Comments
 (0)