Skip to content
New issue

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

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

Already on GitHub? # to your account

Event Flows for Tangle #363

Merged
merged 9 commits into from
Oct 24, 2024
Merged

Event Flows for Tangle #363

merged 9 commits into from
Oct 24, 2024

Conversation

tbraun96
Copy link
Contributor

@tbraun96 tbraun96 commented Oct 19, 2024

Changes to Gadget: Tangle Event Flows and Macro Codegen Improvements

Core Event Listener Improvements

  • Simplified event listener architecture by consolidating common patterns
  • Removed redundant code in Tangle event handling
  • Made event type handling more explicit and type-safe

Macro and Code Generation Updates

  • Streamlined job macro implementation to be more maintainable
  • Removed tangle event handlers
  • Removed unnecessary code duplication in macro generation
  • Enhanced type safety in generated code

Tangle Integration Changes

  • Reorganized Tangle event listener code into a more focused structure
  • Improved handling of Tangle service events and job results

Testing Framework

  • Updated test implementations to match new event listener patterns
  • Added integration test for the entire blueprint event flow

Blueprint Examples

  • Updated incredible-squaring blueprint example to use new patterns
  • Simplified example implementations to be more clear

Other Improvements

  • Code cleanup and removal of deprecated patterns
  • Enhanced type safety throughout the codebase

Overall

The blueprint framework is now more:

  • maintainable
  • type-safe
  • easier to understand
  • deduplicated
  • more flexible

@tbraun96 tbraun96 changed the title WIP: Event Flows for Tangle/EVM WIP: Event Flows for Tangle Oct 23, 2024
@tbraun96 tbraun96 changed the title WIP: Event Flows for Tangle Event Flows for Tangle Oct 23, 2024
@drewstone
Copy link
Contributor

CI failing

@tbraun96 tbraun96 force-pushed the evm-listener-improvements-phase2 branch from 3298a57 to 6120e92 Compare October 24, 2024 00:47
@tbraun96 tbraun96 force-pushed the evm-listener-improvements-phase2 branch from 6120e92 to 12520b5 Compare October 24, 2024 00:49
match t {
FieldType::Void => unreachable!("void type should not be in params"),
FieldType::Bool => {
quote! { let Some(Field::Bool(#ident)) = args_iter.next() else { return Ok(vec![]); }; }
quote! { let Some(gadget_sdk::tangle_subxt::tangle_testnet_runtime::api::runtime_types::tangle_primitives::services::field::Field::Bool(#ident)) = args_iter.next() else { #else_block }; }
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need some way to make this switch between two types when we have this on mainnet as well. Would be good to identify what that could look like sooner than later.

@drewstone drewstone merged commit aa13930 into main Oct 24, 2024
3 of 8 checks passed
@drewstone drewstone deleted the evm-listener-improvements-phase2 branch October 24, 2024 07:23
This was referenced Oct 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants