Skip to content

Commit

Permalink
Fix retry and sync_manager tests
Browse files Browse the repository at this point in the history
  • Loading branch information
badrogger committed Nov 3, 2023
1 parent da41525 commit 00b1a52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion skale/transactions/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def tx_failed(self) -> bool:
return not is_success_or_not_performed(self.receipt)

def raise_for_status(self) -> None:
print(self.dry_run_result)
if self.receipt is not None:
if not is_success(self.receipt):
error_msg = self.receipt['error']
Expand Down
6 changes: 4 additions & 2 deletions tests/manager/sync_manager_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from web3.exceptions import ContractLogicError

from skale.transactions.exceptions import DryRunRevertError

import pytest
Expand Down Expand Up @@ -50,9 +52,9 @@ def test_remove_range_bad_params(skale, sync_manager_permissions, block_in_secon
def test_get_range_bad_params(skale, sync_manager_permissions, block_in_seconds):
num = skale.sync_manager.get_ip_ranges_number()
# TODO: Make dry run handle revert that has empty reason properly
with pytest.raises(DryRunRevertError):
with pytest.raises(ContractLogicError):
r = skale.sync_manager.get_ip_range_by_index(num)
with pytest.raises(DryRunRevertError):
with pytest.raises(ContractLogicError):
r = skale.sync_manager.get_ip_range_by_index(0)
r = skale.sync_manager.get_ip_range_by_name('phantom')
assert r.start_ip == '0.0.0.0' and r.end_ip == '0.0.0.0'
3 changes: 2 additions & 1 deletion tests/transaction_tools_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def test_run_tx_with_retry_dry_run_failed(skale):
dry_run_call_mock = mock.Mock(
return_value={
'status': 0,
'error': 'Dry run failed'
'message': 'Dry run test failure',
'error': 'revert'
}
)
account = generate_account(skale.web3)
Expand Down

0 comments on commit 00b1a52

Please sign in to comment.