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 initial Wasm Stardust bindings #967

Merged
merged 12 commits into from Aug 2, 2022
Merged

Add initial Wasm Stardust bindings #967

merged 12 commits into from Aug 2, 2022

Conversation

cycraig
Copy link
Contributor

@cycraig cycraig commented Jul 31, 2022

Description of change

Add initial Wasm bindings for the IOTA UTXO/Stardust DID Method.

Added

  • Add WasmStardustDID.
  • Add WasmStardustDIDUrl.
  • Add WasmStardustDocument.
  • Add WasmStardustDocumentMetadata.
  • Add WasmStardustService.
  • Add WasmStardustVerificationMethod.
  • Add WasmDocumentMetadata.properties().
  • Add WasmDocument.setMetadataPropertyUnchecked().
  • Add WasmDID.METHOD.
  • Add WasmDID.DEFAULT_NETWORK.
  • Add IIotaService interface which extends IService.

Changed

  • Change WasmDocumentMetadata.previousMessageId to not be a getter, for consistency.
  • Change WasmDID.join() to borrow and clone internally.
  • Change IService TypeScript interface to exclude id.
  • Change several Wasm function parameter names to camelCase.

Removed

  • Remove unnecessary parking_lot dependency and wasm-bindgen feature, which was deprecated; enable the "wasm-bindgen" feature for instant directly instead. Added a custom lint to lints.js to catch future breakages.

Links to any relevant issues

Sub-task of #908.

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

Added stardust.ts unit tests. The new lint can be tested by commenting out the instant dependency in Cargo.toml and executing npm run build, which will fail with the lint error.

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@cycraig cycraig 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 Jul 31, 2022
@cycraig cycraig self-assigned this Jul 31, 2022
@cycraig cycraig added this to the v0.7 Features milestone Jul 31, 2022
@cycraig cycraig marked this pull request as ready for review July 31, 2022 20:01
Copy link
Contributor

@olivereanderson olivereanderson left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for working on this!

.wasm_result()
}

// TODO: unpack_from_output/unpackFromOutput ? Feature-gated method, do we need an equivalent?
Copy link
Contributor

Choose a reason for hiding this comment

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

Since unpack can do the job for now, I suggest keeping the todo for now, and we can add it in the future if needed.

@cycraig cycraig mentioned this pull request Aug 2, 2022
10 tasks
@abdulmth
Copy link
Contributor

abdulmth commented Aug 2, 2022

Changes from #965 are fine. My bad, I missed that review request.

@cycraig cycraig merged commit 9443075 into dev Aug 2, 2022
@cycraig cycraig deleted the feat/wasm-stardust branch August 2, 2022 08:40
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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants