Skip to content
Snippets Groups Projects
Commit eaada992 authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] fix bug in tx history table_model.py conditions field update

Fix test
parent f20cb71b
No related branches found
No related tags found
1 merge request!778Release 0.51.0
...@@ -147,7 +147,7 @@ class HistoryTableModel(QAbstractTableModel): ...@@ -147,7 +147,7 @@ class HistoryTableModel(QAbstractTableModel):
sources_conditions = [ sources_conditions = [
source.conditions source.conditions
for source in sources for source in sources
if "%&&%" in source.conditions or "%||%" in source.conditions if "&&" in source.conditions or "||" in source.conditions
] ]
transfer.conditions = ( transfer.conditions = (
sources_conditions[0] if len(sources_conditions) > 0 else None sources_conditions[0] if len(sources_conditions) > 0 else None
......
...@@ -65,9 +65,13 @@ async def test_tx_history_table_model( ...@@ -65,9 +65,13 @@ async def test_tx_history_table_model(
history_table_model.change_transfer(transfers[0]) history_table_model.change_transfer(transfers[0])
assert len(history_table_model.transfers_data) == 2 assert len(history_table_model.transfers_data) == 2
conditions_data = history_table_model.transfers_data[1][ conditions_data = history_table_model.transfers_data[0][
HistoryTableModel.columns_types.index("conditions") HistoryTableModel.columns_types.index("conditions")
] ]
if conditions_data is None:
conditions_data = history_table_model.transfers_data[1][
HistoryTableModel.columns_types.index("conditions")
]
assert ( assert (
conditions_data conditions_data
== "SIG(F3HWkYnUSbdpEueosKqzYd1m8ftwojwE2uXR7ScoAVKo) || (SIG(GfFUvqaVSgCt6nFDQCAuULWk6K16MUDckeyBJQFcaYj7) && CSV(604800))" == "SIG(F3HWkYnUSbdpEueosKqzYd1m8ftwojwE2uXR7ScoAVKo) || (SIG(GfFUvqaVSgCt6nFDQCAuULWk6K16MUDckeyBJQFcaYj7) && CSV(604800))"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment