Skip to content

Commit

Permalink
Merge pull request RGB-Tools#5 from rahilmansuri1/master
Browse files Browse the repository at this point in the history
Add bug report template for issue tracking
  • Loading branch information
pv-gaurangpatel authored Feb 21, 2025
2 parents f18f91b + 2e1a9d8 commit 8036221
Show file tree
Hide file tree
Showing 26 changed files with 138 additions and 41 deletions.
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Bug report"
description: "Create a report to help us improve"
labels: ["bug"]
body:
- type: textarea
id: bug_description
attributes:
label: "Bug description"
description: "Describe the issue, including steps to reproduce it. Add screenshots if useful."
placeholder: "What happened? What did you expect to happen?"
validations:
required: true

- type: input
id: os_version
attributes:
label: "OS version"
description: "Example: Ubuntu 22.04, macOS 14.0, Windows 11"
validations:
required: true

- type: input
id: app_version
attributes:
label: "App version"
description: "Find this in the About page of the app."
validations:
required: true

- type: dropdown
id: mode
attributes:
label: "RLN node connection type"
options:
- Embedded
- Remote
validations:
required: true

- type: dropdown
id: network
attributes:
label: "Bitcoin network"
options:
- Regtest
- Testnet
validations:
required: true

- type: dropdown
id: installation_method
attributes:
label: "Installation method"
options:
- AppImage/DMG
- From source
validations:
required: true

- type: textarea
id: logs
attributes:
label: "Logs and debug data"
description: "Attach the app data directory (location can be found in the About page) and any relevant console logs."
placeholder: "Drag and drop data directory and paste relevant console logs if any."
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
Binary file added src/assets/remote.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/data/repository/setting_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ def get_wallet_type() -> WalletType:
try:
value = local_store.get_value('walletType')
wallet_type = WalletType.EMBEDDED_TYPE_WALLET
if value == 'connect':
wallet_type = WalletType.CONNECT_TYPE_WALLET
if value == WalletType.REMOTE_TYPE_WALLET.value:
wallet_type = WalletType.REMOTE_TYPE_WALLET
return wallet_type
except Exception as exe:
return handle_exceptions(exe)
Expand Down
2 changes: 1 addition & 1 deletion src/data/service/main_asset_page_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def has_non_zero_balance(asset: AssetModel | None) -> bool:
asset for asset in asset_detail.cfa if has_non_zero_balance(asset)
]

if WalletType.CONNECT_TYPE_WALLET.value == wallet_type.value and asset_detail.cfa is not None:
if WalletType.REMOTE_TYPE_WALLET.value == wallet_type.value and asset_detail.cfa is not None:
for asset in asset_detail.cfa:
if asset is None:
continue
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def closeEvent(self, event): # pylint:disable=invalid-name
if cache is not None:
cache.invalidate_cache()
wallet_type: WalletType = SettingRepository.get_wallet_type()
if wallet_type.value == WalletType.CONNECT_TYPE_WALLET.value or page_name in excluded_page:
if wallet_type.value == WalletType.REMOTE_TYPE_WALLET.value or page_name in excluded_page:
QApplication.instance().quit()
else:
self.show_backup_progress()
Expand Down
2 changes: 1 addition & 1 deletion src/model/enums/enums_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class PaymentStatus(str, Enum):
class WalletType(str, Enum):
"""Enum for wallet type"""
EMBEDDED_TYPE_WALLET = 'embedded'
CONNECT_TYPE_WALLET = 'connect'
REMOTE_TYPE_WALLET = 'remote'


class AssetType(str, Enum):
Expand Down
2 changes: 1 addition & 1 deletion src/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<file>assets/qr_code.png</file>
<file>assets/copy.png</file>
<file>assets/embedded.png</file>
<file>assets/connect.png</file>
<file>assets/remote.png</file>
<file>assets/configure_backup.png</file>
<file>assets/show_mnemonic.png</file>
<file>assets/hide_mnemonic.png</file>
Expand Down
Binary file modified src/translations/en_IN.qm
Binary file not shown.
20 changes: 14 additions & 6 deletions src/translations/en_IN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ If you understand the above remarks and wish to proceed, press the button below
</message>
<message>
<source>connection_type</source>
<translation>Select wallet connection type</translation>
<translation>RLN node connection type</translation>
</message>
<message>
<source>embedded</source>
Expand Down Expand Up @@ -1663,10 +1663,18 @@ If you understand the above remarks and wish to proceed, press the button below
<message>
<source>rgb_invoice_label</source>
<translation>RGB invoice</translation>
</message>
<message>
<source>copied</source>
<translation>Copied!</translation>
</message>
</message>
<message>
<source>copied</source>
<translation>Copied!</translation>
</message>
<message>
<source>data_directory_path_label</source>
<translation>Data directory path:</translation>
</message>
<message>
<source>remote</source>
<translation>Remote</translation>
</message>
</context>
</TS>
5 changes: 3 additions & 2 deletions src/utils/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from src.model.enums.enums_model import AssetType
from src.model.enums.enums_model import NetworkEnumModel
from src.model.enums.enums_model import TokenSymbol
from src.model.enums.enums_model import WalletType
from src.model.selection_page_model import SelectionPageModel
from src.utils.constant import APP_NAME
from src.utils.constant import BITCOIN_EXPLORER_URL
Expand Down Expand Up @@ -443,8 +444,8 @@ def close_button_navigation(parent, back_page_navigation=None):
title = 'connection_type'
logo_1_path = ':/assets/embedded.png'
logo_1_title = 'embedded'
logo_2_path = ':/assets/connect.png'
logo_2_title = 'connect'
logo_2_path = ':/assets/remote.png'
logo_2_title = WalletType.REMOTE_TYPE_WALLET.value
params = SelectionPageModel(
title=title,
logo_1_path=logo_1_path,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
NODE_PUB_KEY = 'node_pub_key'
NETWORK_KET = 'network'
IS_EMBEDDED_KEY = 'embedded'
IS_CONNECT_KEY = 'connect'
IS_REMOTE_KEY = 'remote'
CACHE_FILE_NAME = {
NetworkEnumModel.MAINNET: 'iris-wallet-catch-mainnet',
NetworkEnumModel.TESTNET: 'iris-wallet-catch-testnet',
Expand Down
2 changes: 1 addition & 1 deletion src/viewmodels/ln_endpoint_view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def on_error(self, error: Exception):
self.stop_loading_message.emit(False)
if error.message == QCoreApplication.translate('iris_wallet_desktop', 'not_initialized', None):
self._page_navigation.set_wallet_password_page(
WalletType.CONNECT_TYPE_WALLET.value,
WalletType.REMOTE_TYPE_WALLET.value,
)
elif error.message == QCoreApplication.translate('iris_wallet_desktop', 'wrong_password', None):
self._page_navigation.enter_wallet_password_page()
Expand Down
4 changes: 2 additions & 2 deletions src/viewmodels/term_view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def on_accept_click(self):
title = 'connection_type'
embedded_logo = ':/assets/embedded.png'
logo_1_title = WalletType.EMBEDDED_TYPE_WALLET.value
connect_logo = ':/assets/connect.png'
logo_2_title = WalletType.CONNECT_TYPE_WALLET.value
connect_logo = ':/assets/remote.png'
logo_2_title = WalletType.REMOTE_TYPE_WALLET.value
params = SelectionPageModel(
title=title,
logo_1_path=embedded_logo,
Expand Down
18 changes: 18 additions & 0 deletions src/views/ui_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ def __init__(self, view_model):
translation_key='announce_alias', value=self.get_bitcoin_config.announce_alias, v_layout=self.about_vertical_layout,
)

basepath = local_store.get_path()
self.data_directory_path = NodeInfoWidget(
translation_key='data_directory_path_label', value=basepath, v_layout=self.about_vertical_layout,
)

connection_type: WalletType = SettingRepository.get_wallet_type()

self.rln_node_connection_type = NodeInfoWidget(
translation_key='connection_type', value=connection_type.value.capitalize(), v_layout=self.about_vertical_layout,
)

self.privacy_policy_label = QLabel(self.about_widget)
self.privacy_policy_label.setObjectName('privacy_policy_label')
self.privacy_policy_label.setTextInteractionFlags(
Expand Down Expand Up @@ -197,6 +208,13 @@ def retranslate_ui(self):
'iris_wallet_desktop', 'download_debug_log', None,
),
)
self.rln_node_connection_type.key_label.setText(
f"{
QCoreApplication.translate(
'iris_wallet_desktop', 'connection_type'
)
}:",
)

def setup_ui_connection(self):
"""Set up connections for UI elements."""
Expand Down
2 changes: 1 addition & 1 deletion src/views/ui_fungible_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def handle_backup_visibility(self):
"""This method handle the backup visibility on embedded or connect wallet type."""
wallet_type: WalletType = SettingRepository.get_wallet_type()
self.sidebar = self._view_model.page_navigation.sidebar()
if WalletType.CONNECT_TYPE_WALLET.value == wallet_type.value:
if WalletType.REMOTE_TYPE_WALLET.value == wallet_type.value:
self.sidebar.backup.hide()
if WalletType.EMBEDDED_TYPE_WALLET.value == wallet_type.value:
self.sidebar.backup.show()
Expand Down
6 changes: 3 additions & 3 deletions src/views/ui_set_wallet_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ def close_navigation(self):
"""This method handled close button navigation"""
if self.originating_page == WalletType.EMBEDDED_TYPE_WALLET.value:
self._view_model.page_navigation.welcome_page()
if self.originating_page == WalletType.CONNECT_TYPE_WALLET.value:
if self.originating_page == WalletType.REMOTE_TYPE_WALLET.value:
title = 'connection_type'
embedded_path = ':/assets/embedded.png'
embedded_title = WalletType.EMBEDDED_TYPE_WALLET.value
connect_path = ':/assets/connect.png'
connect_title = WalletType.CONNECT_TYPE_WALLET.value
connect_path = ':/assets/remote.png'
connect_title = WalletType.REMOTE_TYPE_WALLET.value
params = SelectionPageModel(
title=title,
logo_1_path=embedded_path,
Expand Down
6 changes: 3 additions & 3 deletions src/views/ui_wallet_or_transfer_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ def handle_frame_click(self, _id):
SettingRepository.set_wallet_type(WalletType.EMBEDDED_TYPE_WALLET)
self._view_model.wallet_transfer_selection_view_model.start_node_for_embedded_option()

# Handle the 'connect' frame click event
elif _id == WalletType.CONNECT_TYPE_WALLET.value:
SettingRepository.set_wallet_type(WalletType.CONNECT_TYPE_WALLET)
# Handle the 'remote' frame click event
elif _id == WalletType.REMOTE_TYPE_WALLET.value:
SettingRepository.set_wallet_type(WalletType.REMOTE_TYPE_WALLET)
self._view_model.page_navigation.ln_endpoint_page(
'wallet_selection_page',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_get_asset_when_wallet_type_connect(
mock_is_exhausted_asset_enabled,
):
"""Test case for main asset page service when wallet type connect"""
wallet_type = mock_get_wallet_type(WalletType.CONNECT_TYPE_WALLET)
wallet_type = mock_get_wallet_type(WalletType.REMOTE_TYPE_WALLET)
get_btc_balance = mock_get_btc_balance(mock_balance_response_data)
refresh_asset = mock_refresh_transfer(
RefreshTransferResponseModel(status=True),
Expand Down
2 changes: 2 additions & 0 deletions unit_tests/tests/ui_tests/ui_about_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ def mock_node_info_widget(mocker):
mock = mocker.patch(
'src.views.components.wallet_detail_frame.NodeInfoWidget', autospec=True,
)
mock_instance = mock.return_value
mock_instance.key_label = mocker.MagicMock()
mocker.patch('src.views.ui_about.NodeInfoWidget', mock)

# Print mock details
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/tests/ui_tests/ui_fungible_asset_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def test_handle_backup_visibility(create_fungible_asset_widget):
# Mock the SettingRepository to return CONNECT_TYPE_WALLET
with patch('src.views.ui_fungible_asset.SettingRepository.get_wallet_type') as mock_get_wallet_type:
# Test for CONNECT_TYPE_WALLET
mock_get_wallet_type.return_value = WalletType.CONNECT_TYPE_WALLET
mock_get_wallet_type.return_value = WalletType.REMOTE_TYPE_WALLET

# Call the method
widget.handle_backup_visibility()
Expand Down
6 changes: 3 additions & 3 deletions unit_tests/tests/ui_tests/ui_set_wallet_password_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def set_wallet_password_widget(qtbot):
mock_navigation = MagicMock()
view_model = MagicMock(MainViewModel(mock_navigation))
widget = SetWalletPasswordWidget(
view_model, WalletType.CONNECT_TYPE_WALLET.value,
view_model, WalletType.REMOTE_TYPE_WALLET.value,
)
qtbot.addWidget(widget)
return widget
Expand All @@ -39,7 +39,7 @@ def test_close_navigation(set_wallet_password_widget: SetWalletPasswordWidget):
set_wallet_password_widget._view_model.page_navigation.welcome_page.assert_called_once()

# Test for Connect Wallet Type
set_wallet_password_widget.originating_page = WalletType.CONNECT_TYPE_WALLET.value
set_wallet_password_widget.originating_page = WalletType.REMOTE_TYPE_WALLET.value
set_wallet_password_widget.close_navigation()

# Verify that wallet_connection_page is called with the correct parameters
Expand All @@ -50,7 +50,7 @@ def test_close_navigation(set_wallet_password_widget: SetWalletPasswordWidget):
params = args[0]
assert params.title == 'connection_type'
assert params.logo_1_title == WalletType.EMBEDDED_TYPE_WALLET.value
assert params.logo_2_title == WalletType.CONNECT_TYPE_WALLET.value
assert params.logo_2_title == WalletType.REMOTE_TYPE_WALLET.value


def test_set_password_suggestion(set_wallet_password_widget: SetWalletPasswordWidget):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def wallet_or_transfer_selection_widget(qtbot):
title='connection_type',
logo_1_title='embedded',
logo_1_path=':/assets/embedded.png',
logo_2_title='connect',
logo_2_path=':/assets/connect.png',
logo_2_title='remote',
logo_2_path=':/assets/remote.png',
callback='None',
asset_id='None',
)
Expand All @@ -42,7 +42,7 @@ def test_retranslate_ui(wallet_or_transfer_selection_widget: WalletOrTransferSel
wallet_or_transfer_selection_widget.retranslate_ui()

assert wallet_or_transfer_selection_widget.option_1_text_label.text() == 'embedded'
assert wallet_or_transfer_selection_widget.option_2_text_label.text() == 'connect'
assert wallet_or_transfer_selection_widget.option_2_text_label.text() == 'remote'


def test_handle_frame_click_embedded_wallet(wallet_or_transfer_selection_widget: WalletOrTransferSelectionWidget, mocker):
Expand Down Expand Up @@ -80,12 +80,12 @@ def test_handle_frame_click_connect_wallet(wallet_or_transfer_selection_widget:

# Call the method with the connect wallet ID
wallet_or_transfer_selection_widget.handle_frame_click(
WalletType.CONNECT_TYPE_WALLET.value,
WalletType.REMOTE_TYPE_WALLET.value,
)

# Assertions
mock_set_wallet_type.assert_called_once_with(
WalletType.CONNECT_TYPE_WALLET,
WalletType.REMOTE_TYPE_WALLET,
)
mock_ln_endpoint_page.assert_called_once_with('wallet_selection_page')

Expand Down
4 changes: 2 additions & 2 deletions unit_tests/tests/utils_test/common_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ def test_close_button_navigation_wallet_selection_page(mock_page_navigation):
title='connection_type',
logo_1_path=':/assets/embedded.png',
logo_1_title='embedded',
logo_2_path=':/assets/connect.png',
logo_2_title='connect',
logo_2_path=':/assets/remote.png',
logo_2_title='remote',
asset_id='none',
asset_name=None,
callback='none',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_on_error_wallet_not_initialized(mock_qcore, mock_logger, mock_toast_man

# Verify navigation page change
mock_page_navigation.set_wallet_password_page.assert_called_once_with(
WalletType.CONNECT_TYPE_WALLET.value,
WalletType.REMOTE_TYPE_WALLET.value,
)

# Verify ToastManager call
Expand Down Expand Up @@ -262,7 +262,7 @@ def test_on_error_common_exception_not_initialized(ln_endpoint_vm, mocker):
# Assert
ln_endpoint_vm.stop_loading_message.emit.assert_called_once_with(False)
ln_endpoint_vm._page_navigation.set_wallet_password_page.assert_called_once_with(
WalletType.CONNECT_TYPE_WALLET.value,
WalletType.REMOTE_TYPE_WALLET.value,
)
mock_toast_manager.assert_called_once_with(description=error_msg)
mock_logger.assert_called_once_with(
Expand Down
Loading

0 comments on commit 8036221

Please sign in to comment.