common crate for wasm shims #1366
Draft
+1,199
−970
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a common crate & some utilities for testing WebAssembly
rand_xx
fns that were duplicated across a couple cratestime::
shims, that are now accessible viaxmtp_common::time
. It should be a drop-in replacement forstd::time
, and preferable to use instead ofstd::time
xmtp_common::yield_
which delegates to tokio or the browsers executor depending on environment. Should be preferred overtokio::task::yield
, since a WebAssembly future may not necessarily be running in a tokio executorretry
moved fromxmtp_mls
tocommon
. Retry is general enough that this makes sense, and allows it to be used without including all ofxmtp_mls
.traced_test
moved fromxmtp_mls
to common. Also general enough to be used w/o mls, and useful elsewherexmtp_common
includes a commonlogger
initializer toggling on environment,xmtp_common::logger
assert_x
andoptify
macros moved tocommon
store/mod.rs
create triggers to track intent metadata (created/published/deleted) and exposed for tests onDbConnection