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

WASM Move Calls #1499

Open
wants to merge 6 commits into
base: feat/wasm32-develop-alpha
Choose a base branch
from
Open

Conversation

UMR1352
Copy link
Contributor

@UMR1352 UMR1352 commented Jan 15, 2025

Description of change

Port all calls to move functions to TS using IOTA's TS SDK and bind these move calls through WASM into iota_interaction_ts package.

Links to any relevant issues

Closes #1449

Type of change

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Huge trust me bro as the project is not yet compilable.

@UMR1352 UMR1352 added Wasm Related to Wasm bindings. Becomes part of the Wasm changelog Added A new feature that requires a minor release. Part of "Added" section in changelog labels Jan 15, 2025
@UMR1352 UMR1352 added this to the v1.6 milestone Jan 15, 2025
@UMR1352 UMR1352 self-assigned this Jan 15, 2025
@UMR1352 UMR1352 requested a review from a team as a code owner January 15, 2025 08:48
Comment on lines +242 to +249
// Use cell to move `intent_fn` inside `closure` without actually moving it.
// This ensures that `closure` is an `impl Fn(..)` instead of `impl FnOnce(..)` like `intent_fn`.
let wrapped_intent_fn = Cell::new(Some(intent_fn));
let closure = |tx_builder: WasmTransactionBuilder, args: WasmTxArgumentMap| {
let mut builder = TransactionBuilderTsSdk::new(tx_builder);
let args = serde_wasm_bindgen::from_value(args.into()).expect("failed to convert JS argument map");
wrapped_intent_fn.take().unwrap()(&mut builder, &args);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check this out! 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added A new feature that requires a minor release. Part of "Added" section in changelog Wasm Related to Wasm bindings. Becomes part of the Wasm changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant