contracts: Allow ChainExtension::call() to access &mut self (#11874)

* Give chain extensions the ability to store some temporary values

* Update frame/contracts/src/wasm/runtime.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Rename func_id -> id

* Replace `id` param by two functions on `env`

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
Alexander TheißenandHernando Castano authored and GitHub committed 2022-07-25 15:48:01 +00:00
1 parent 626140454d
commit c470e9d11d
6 files changed
+254 -56

No files matched your search

+1 -1
View File
@@ -280,7 +280,7 @@ pub mod pallet {
type WeightInfo: WeightInfo;
/// Type that allows the runtime authors to add new host functions for a contract to call.
type ChainExtension: chain_extension::ChainExtension<Self>;
type ChainExtension: chain_extension::ChainExtension<Self> + Default;
/// Cost schedule and limits.
#[pallet::constant]