Cardinal-Cryptography / Cardinal-Cryptography/ink-wrapper

Upload should inline the Wasm

Open
#70 1 comment 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
Rust
Stars
12
Forks
4
PR merge metrics
No merged PRs in 30d

Description

When specifying the `--wasm-path` of the contract, the new method `fn upload` will be generated. It will use `include_bytes!(wasm_path)` which includes bytes of the contract. It's very fragile since it requires that at the time of calling the `ink-wrapper`, the `--wasm-path /path/to/wasm/file` is correct with regards to where it will be used, not where it's currently called from. I.e. the relative path to the Wasm file MUST be specified for the call time, not generation time. See https://github.com/Cardinal-Cryptography/ink-wrapper/blob/aleph-client-compat/Makefile#L38-L50 for example how this path changes.

Instead, we could simply inline the whole body of the contract as an array in the same file as the wrappers. Or, alternatively, inline it in a separate file but output it alongside the wrapper and call `include_bytes!` on it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.