ewasm-rust-api icon indicating copy to clipboard operation
ewasm-rust-api copied to clipboard

Turn ewasm_api into a trait

Open axic opened this issue 6 years ago • 4 comments

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 avatar Aug 11 '18 14:08 axic

@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.

jakelang avatar Aug 11 '18 17:08 jakelang

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 avatar Aug 11 '18 17:08 axic

@axic I want #6 to be merged before this is implemented, to avoid nasty diffs and merge conflicts.

jakelang avatar Sep 01 '18 22:09 jakelang

Here's some initial work from August: https://github.com/ewasm/ewasm-rust-api/tree/turn-into-trait

axic avatar Nov 29 '18 18:11 axic