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

common crate for wasm shims #1366

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

insipx
Copy link
Contributor

@insipx insipx commented Dec 3, 2024

This PR adds a common crate & some utilities for testing WebAssembly

  • creates common crate that houses:
    • the rand_xx fns that were duplicated across a couple crates
    • web assembly time:: shims, that are now accessible via xmtp_common::time. It should be a drop-in replacement for std::time, and preferable to use instead of std::time
    • xmtp_common::yield_ which delegates to tokio or the browsers executor depending on environment. Should be preferred over tokio::task::yield, since a WebAssembly future may not necessarily be running in a tokio executor
    • retry moved from xmtp_mls to common. Retry is general enough that this makes sense, and allows it to be used without including all of xmtp_mls.
    • traced_test moved from xmtp_mls to common. Also general enough to be used w/o mls, and useful elsewhere
    • xmtp_common includes a common logger initializer toggling on environment, xmtp_common::logger
  • assert_x and optify macros moved to common
  • new test utilities in store/mod.rs create triggers to track intent metadata (created/published/deleted) and exposed for tests on DbConnection

Copy link
Contributor Author

insipx commented Dec 3, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@insipx insipx force-pushed the 11-30-common_crate_for_wasm_shims branch from c33b5ba to cf10919 Compare December 4, 2024 19:41
@insipx insipx force-pushed the 11-30-common_crate_for_wasm_shims branch from cf10919 to f8d41b5 Compare December 6, 2024 19:45
@insipx insipx force-pushed the 11-30-common_crate_for_wasm_shims branch 10 times, most recently from 3df89c2 to 919f767 Compare December 11, 2024 16:25
@insipx insipx force-pushed the 11-30-common_crate_for_wasm_shims branch 3 times, most recently from 78b7065 to 659acd1 Compare December 11, 2024 21:17
@insipx insipx force-pushed the 11-30-common_crate_for_wasm_shims branch from 659acd1 to 718950b Compare December 11, 2024 21:22
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.

1 participant