Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Feb 2, 2024
1 parent ce81044 commit e439fc0
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 18 deletions.
4 changes: 1 addition & 3 deletions examples/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ def main():

result = Xrpld.submit(context.client, SmartContractParams(alice_wallet, built_tx))

hook_executions = ExecutionUtility.get_hook_executions_from_meta(
context.client, result["meta"]
)
hook_executions = ExecutionUtility.get_hook_executions_from_meta(result["meta"])

print(hook_executions.executions[0].HookReturnString)

Expand Down
1 change: 0 additions & 1 deletion hooks_toolkit/asyncio_xrpld.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ async def submit(client: Client, params: SmartContractParams) -> Any:
tx_result = tx_response.result.get("meta")["TransactionResult"]
if tx_result == "tecHOOK_REJECTED":
hook_executions = ExecutionUtility.get_hook_executions_from_meta(
client,
tx_response.result.get("meta"),
)
raise ValueError(hook_executions.executions[0].HookReturnString)
Expand Down
1 change: 0 additions & 1 deletion hooks_toolkit/xrpld.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def submit(client: Client, params: SmartContractParams) -> Any:
tx_result = tx_response.result.get("meta")["TransactionResult"]
if tx_result == "tecHOOK_REJECTED":
hook_executions = ExecutionUtility.get_hook_executions_from_meta(
client,
tx_response.result.get("meta"),
)
raise ValueError(hook_executions.executions[0].HookReturnString)
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/integration/hooks/toolbox/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_base(cls):
)

hook_executions = ExecutionUtility.get_hook_executions_from_meta(
cls.context.client, result["meta"]
result["meta"]
)

cls.assertEqual(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/hooks/toolbox/test_hook_on_tt.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_hook_on_tt(cls):
)

hook_executions = ExecutionUtility.get_hook_executions_from_meta(
cls.context.client, result["meta"]
result["meta"]
)

cls.assertEqual(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/hooks/toolbox/test_param_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_param_basic(cls):
)

hook_executions = ExecutionUtility.get_hook_executions_from_meta(
cls.context.client, result["meta"]
result["meta"]
)

cls.assertEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TestExecutionUtility(AsyncioIntegrationTestCase):
async def test_executions_from_meta(cls):
async def async_test_executions_from_meta(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down Expand Up @@ -60,7 +60,7 @@ async def test_executions_from_meta(cls):
cls.context.client, cls.context.hook1.seed, [clear_hook]
)

async def test_executions_from_tx_hash(cls):
async def async_test_executions_from_tx_hash(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down Expand Up @@ -107,7 +107,7 @@ async def test_executions_from_tx_hash(cls):
cls.context.client, cls.context.hook1.seed, [clear_hook]
)

async def test_emissions_from_meta(cls):
async def async_test_emissions_from_meta(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class TestStateUtility(AsyncioIntegrationTestCase):
async def test_get_hook(cls):
async def async_test_get_hook(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down Expand Up @@ -60,7 +60,7 @@ async def test_get_hook(cls):
cls.context.client, cls.context.hook1.seed, [clear_hook]
)

async def test_get_hook_definition(cls):
async def async_test_get_hook_definition(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down Expand Up @@ -105,7 +105,7 @@ async def test_get_hook_definition(cls):
cls.context.client, cls.context.hook1.seed, [clear_hook]
)

async def test_hook_state_dir(cls):
async def async_test_hook_state_dir(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down Expand Up @@ -150,7 +150,7 @@ async def test_hook_state_dir(cls):
cls.context.client, cls.context.hook1.seed, [clear_hook]
)

async def test_hook_state(cls):
async def async_test_hook_state(cls):
async with cls.context.client as _:
hook = create_hook_payload(
SetHookParams(
Expand Down

0 comments on commit e439fc0

Please sign in to comment.