Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to ABIResult #342

Merged
merged 4 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions algosdk/atomic_transaction_composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ def execute(
return_value=return_value,
decode_error=decode_error,
tx_info=tx_info,
method=self.method_dict[i],
)
)
continue
Expand Down Expand Up @@ -545,6 +546,7 @@ def execute(
return_value=return_value,
decode_error=decode_error,
tx_info=tx_info,
method=self.method_dict[i],
)
method_results.append(abi_result)

Expand Down Expand Up @@ -692,12 +694,14 @@ def __init__(
return_value: Any,
decode_error: Optional[Exception],
tx_info: dict,
method: abi.Method,
) -> None:
self.tx_id = tx_id
self.raw_value = raw_value
self.return_value = return_value
self.decode_error = decode_error
self.tx_info = tx_info
self.method = method


class AtomicTransactionResponse:
Expand Down
8 changes: 1 addition & 7 deletions test/steps/application_v2_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,11 @@ def create_atomic_transaction_composer(context):
context.atomic_transaction_composer = (
atomic_transaction_composer.AtomicTransactionComposer()
)
context.method_list = []


@step('I create the Method object from method signature "{method_signature}"')
def build_abi_method(context, method_signature):
context.abi_method = abi.Method.from_signature(method_signature)
if not hasattr(context, "method_list"):
context.method_list = []
context.method_list.append(context.abi_method)


@step("I make a transaction signer for the {account_type} account.")
Expand Down Expand Up @@ -789,9 +785,7 @@ def check_atomic_transaction_composer_response(context, returns):
assert result.decode_error is None
continue
expected_bytes = base64.b64decode(expected)
expected_value = context.method_list[i].returns.type.decode(
expected_bytes
)
expected_value = result.method.returns.type.decode(expected_bytes)

assert expected_bytes == result.raw_value, "actual is {}".format(
result.raw_value
Expand Down