Implement seal_set_code_hash
and add example contract
#1185
Labels
A-examples
[examples] Work item
A-ink_env
[ink_env] work item
E-mentor-available
A mentor for this issue is available
good first issue
Good for newcomers
I've marked this issues as a good first one since the task is something that can be done mostly analog to already existing code.
ink! interfaces with Substrate's
contracts
pallet via an API. The API functions are named with the prefixseal_
‒ so e.g.seal_call
. From time to time new API functions are added. One recently added one isseal_set_code_hash
, you can find it here: https://github.com/paritytech/substrate/blob/master/frame/contracts/src/wasm/runtime.rs#L1976-L2011. It was added in paritytech/substrate#10567.While the
contracts
pallet side has been implemented we are missing a possibility to invoke this function from ink!.ToDo
ink_env::set_code_hash
.Take a look at the file
env/src/api.rs
, it should be possible to take one of the functions there (e.g.is_contract
) and implement this new function analog.seal_set_code_hash
in this file: https://github.com/paritytech/ink/blob/master/crates/env/src/engine/on_chain/ext.rs#L341. Add it as an__unstable__
function there.unimplemented!("off-chain environment does not yet support …");
there.The text was updated successfully, but these errors were encountered: