ewasm-rust-api
ewasm-rust-api copied to clipboard
Turn ewasm_api into a trait
And provide two implementations:
- native
- scaffolded (* maybe look for a better name)
The native one wraps around the C functions, while the scaffolded can be used for testing.
@axic I think that EEI as a trait doesn't make sense. I would bottle it up into a module so that it can still be isolated in its own namespace, but since it isn't an interface for a type it shouldn't be a trait.
As a module, EEI methods can be called like ewasm_rust_api::eei::function(args)
without being associated to a type.
Whatever is the right Rust term, it would make sense to have the ability to swap out the underlying implementation with preloaded data to enable proper in-Rust testing of the precompiles/runevm.
@axic I want #6 to be merged before this is implemented, to avoid nasty diffs and merge conflicts.
Here's some initial work from August: https://github.com/ewasm/ewasm-rust-api/tree/turn-into-trait