Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Fix events #118

Merged
merged 5 commits into from
Jun 7, 2022
Merged

Fix events #118

merged 5 commits into from
Jun 7, 2022

Conversation

badurinantun
Copy link
Contributor

@badurinantun badurinantun commented Jun 6, 2022

Usage related changes

Development related changes

  • Test event contract invoke from the account

Checklist:

  • Performed a self-review of the code
  • Rebased to the base branch
  • Documented the changes
  • Updated the tests
  • All tests are passing

@badurinantun badurinantun self-assigned this Jun 6, 2022
@badurinantun badurinantun marked this pull request as ready for review June 6, 2022 11:38
@badurinantun badurinantun requested a review from FabijanC June 6, 2022 11:38
@@ -52,8 +52,10 @@ def __get_actual_fee(self) -> int:

def __get_events(self) -> List[Event]:
"""Returns the events"""
contract_address = self.execution_info.call_info.contract_address
return [Event.create(event_content=e, emitting_contract_address=contract_address) for e in self.execution_info.call_info.events]
if isinstance(self.execution_info, StarknetTransactionExecutionInfo):
Copy link
Collaborator

@FabijanC FabijanC Jun 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which other class can it be (other than StarknetTransactionExecutionInfo)? And when is it so? Why doesn't that other class support using raw_events?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What other type it can be is defined by in the execution_info type. It can be either TransactionExecutionInfo for invokes or StarknetTransactionExecutionInfo for deploys

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, forgot about that. That type is actually not specified correctly: or shouldn't be used for parameter types, typing.Union should (in other places in the project as well). An even better solution would be not to have all the ifs in the code, but one class for each transaction type.

Copy link
Contributor Author

@badurinantun badurinantun Jun 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the only if. We could transform TransactionExecutionInfo to StarknetTransactionExecutionInfo but I made a priority of fixing this instead. Transforming it to StarknetTransactionExecutionInfo is not trivial because of the events

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FabijanC FabijanC merged commit 30b9a54 into master Jun 7, 2022
@FabijanC FabijanC deleted the fix-events branch June 7, 2022 07:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Events no longer show up on Receipts as of 0.2.2
2 participants