Skip to content

Conversation

@michaelx11
Copy link
Contributor

@michaelx11 michaelx11 commented Feb 3, 2023

Goal

This PR follows the structure of other example Rust crossplatform libraries I've seen (link)

The structure is:

  • Move core implementation in Rust into a separate crate, unaware of any platform bindings
  • Move bindings into their own subdirectories and crates

In this case it manifests as:

  • New xmtp-keystore crate (open to renaming ideas)
  • Move existing repo contents into bindings/wasm subdirectory

Changes

  • Restructuring as mentioned above
  • In xmtp-keystore, we build with ethers-rs just to show we can, and generate a mnemonic to show we can exercise code
  • In bindings/wasm we add a dependency on xmtp-keystore, modify the API, and add tests to exercise generateMnemonic

Testing

  • npm run prepublishOnly now shows two tests running successfully.
 ✓ tests/wasmpkg.test.ts (2)

 Test Files  1 passed (1)
      Tests  2 passed (2)
   Start at  12:41:58
   Duration  508ms (transform 208ms, setup 0ms, collect 10ms, tests 4ms)

@michaelx11 michaelx11 requested a review from jazzz February 3, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants