iroha icon indicating copy to clipboard operation
iroha copied to clipboard

[feature] #2511: Restrict FFI types on wasm

Open Erigara opened this issue 3 years ago • 1 comments

Signed-off-by: Shanin Roman [email protected]

Description of the Change

  • Add wasm feature to iroha_ffi crate;
  • Add PrimitiveRepr trait to substitute unsupported types with supported ones;
  • Refactor Vec transfer through ff-boundry.

Issue

Closes #2511.

Benefits

Protect from various errors (when user can pass u32 where u8 supposed to be).

Possible Drawbacks

More complex implementation.

Usage Examples or Tests [optional]

Alternate Designs [optional]

Erigara avatar Aug 03 '22 15:08 Erigara

Codecov Report

Merging #2590 (47bc640) into iroha2-dev (a16d9c3) will decrease coverage by 1.74%. The diff coverage is 63.26%.

:exclamation: Current head 47bc640 differs from pull request most recent head 762bbb9. Consider uploading reports for the commit 762bbb9 to get more accurate results

@@              Coverage Diff               @@
##           iroha2-dev    #2590      +/-   ##
==============================================
- Coverage       67.61%   65.86%   -1.75%     
==============================================
  Files             140      156      +16     
  Lines           26173    28198    +2025     
==============================================
+ Hits            17696    18574     +878     
- Misses           8477     9624    +1147     
Impacted Files Coverage Δ
cli/derive/src/lib.rs 74.72% <ø> (ø)
cli/src/torii/mod.rs 28.88% <ø> (ø)
cli/src/torii/routing.rs 69.92% <0.00%> (-2.87%) :arrow_down:
client/src/client.rs 43.36% <0.00%> (-2.96%) :arrow_down:
client_cli/src/main.rs 0.26% <ø> (ø)
config/base/src/runtime_upgrades.rs 35.63% <ø> (ø)
core/src/block.rs 70.00% <ø> (ø)
core/src/queue.rs 95.67% <ø> (-0.08%) :arrow_down:
core/src/smartcontracts/isi/asset.rs 54.82% <ø> (ø)
core/src/smartcontracts/wasm.rs 95.39% <ø> (+0.12%) :arrow_up:
... and 154 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 03 '22 15:08 codecov[bot]