Skip to content

Commit

Permalink
Restore test errors, better err output from framework (#2342)
Browse files Browse the repository at this point in the history
* Isolate linux specific helpers

* Reduce transfer domain noise

* Add ExtendedTxToUniv

* Add log category CONNECT and SIGN

* Split more

* Fix txdest abstraction defaults

* Restore test errors, better error out
  • Loading branch information
prasannavl authored Aug 17, 2023
1 parent cd461d2 commit 900afac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
18 changes: 6 additions & 12 deletions test/functional/feature_evm_transferdomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,6 @@ def invalid_parameters(self):
)

def invalid_values_dvm_evm(self):
# Check for valid values DVM->EVM in transferdomain rpc
assert_raises_rpc_error(
None,
None,
lambda: transfer_domain(self.nodes[0], self.address, self.eth_address, "100@DFI", 2, 3)
)
assert_raises_rpc_error(
-32600,
'Dst address must be an ERC55 address in case of "EVM" domain',
Expand Down Expand Up @@ -518,8 +512,8 @@ def invalid_values_evm_dvm(self):
],
)
assert_raises_rpc_error(
None,
None,
-32600,
'Dst address must be a legacy or Bech32 address in case of "DVM" domain',
self.nodes[0].transferdomain,
[
{
Expand All @@ -537,8 +531,8 @@ def invalid_values_evm_dvm(self):
],
)
assert_raises_rpc_error(
None,
None,
-32600,
"Cannot transfer inside same domain",
self.nodes[0].transferdomain,
[
{
Expand All @@ -552,8 +546,8 @@ def invalid_values_evm_dvm(self):
],
)
assert_raises_rpc_error(
None,
None,
-32600,
"Source amount must be equal to destination amount",
self.nodes[0].transferdomain,
[
{
Expand Down
3 changes: 2 additions & 1 deletion test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def try_rpc(code, message, fun, *args, **kwds):
except JSONRPCException as e:
# JSONRPCException was thrown as expected. Check the code and message values are correct.
if (code is not None) and (code != e.error["code"]):
raise AssertionError("Unexpected JSONRPC error code %i" % e.error["code"])
err_str = str(e.error["code"]) + " (" + e.error["message"] + ")"
raise AssertionError("Unexpected JSONRPC error code: " + err_str)
if (message is not None) and (message not in e.error["message"]):
raise AssertionError(
"Expected substring (" + message + ") not found:" + e.error["message"]
Expand Down

0 comments on commit 900afac

Please sign in to comment.