From 8e736cf2881b7459ec47fd3c4c138528236382af Mon Sep 17 00:00:00 2001 From: Cyrill Leutwiler Date: Wed, 31 Jan 2024 11:05:39 +0100 Subject: [PATCH 1/3] stabilize caller_is_root API Signed-off-by: Cyrill Leutwiler --- substrate/frame/contracts/src/wasm/runtime.rs | 1 - substrate/frame/contracts/uapi/src/host.rs | 3 --- 2 files changed, 4 deletions(-) diff --git a/substrate/frame/contracts/src/wasm/runtime.rs b/substrate/frame/contracts/src/wasm/runtime.rs index 3e49b68f86b6c..3af0d04a3ad13 100644 --- a/substrate/frame/contracts/src/wasm/runtime.rs +++ b/substrate/frame/contracts/src/wasm/runtime.rs @@ -1542,7 +1542,6 @@ pub mod env { /// Checks whether the caller of the current contract is root. /// See [`pallet_contracts_uapi::HostFn::caller_is_root`]. - #[unstable] fn caller_is_root(ctx: _, _memory: _) -> Result { ctx.charge_gas(RuntimeCosts::CallerIsRoot)?; Ok(ctx.ext.caller_is_root() as u32) diff --git a/substrate/frame/contracts/uapi/src/host.rs b/substrate/frame/contracts/uapi/src/host.rs index 21350bc4eb3e4..c8b9ae8b2def9 100644 --- a/substrate/frame/contracts/uapi/src/host.rs +++ b/substrate/frame/contracts/uapi/src/host.rs @@ -277,9 +277,6 @@ pub trait HostFn { /// /// A return value of `true` indicates that this contract is being called by a root origin, /// and `false` indicates that the caller is a signed origin. - #[deprecated( - note = "Unstable function. Behaviour can change without further notice. Use only for testing." - )] fn caller_is_root() -> u32; /// Clear the value at the given key in the contract storage. From 5a25a773cb3fe19f9865e68707bb5f3fada7ba70 Mon Sep 17 00:00:00 2001 From: Cyrill Leutwiler Date: Wed, 31 Jan 2024 11:10:01 +0100 Subject: [PATCH 2/3] prdoc Signed-off-by: Cyrill Leutwiler --- prdoc/pr_3154.prdoc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 prdoc/pr_3154.prdoc diff --git a/prdoc/pr_3154.prdoc b/prdoc/pr_3154.prdoc new file mode 100644 index 0000000000000..0e164d53f65d9 --- /dev/null +++ b/prdoc/pr_3154.prdoc @@ -0,0 +1,8 @@ +title: Contracts: Stabilize caller_is_root API + +doc: + - audience: Runtime Dev + description: | + Removed the `#[unstable]` attrribute on `caller_is_root` host function. + +crates: ["pallet-contracts"] From 193da7c2efd8d447617516511621cd5dcab98bd4 Mon Sep 17 00:00:00 2001 From: Cyrill Leutwiler Date: Wed, 31 Jan 2024 11:18:06 +0100 Subject: [PATCH 3/3] fix prdoc Signed-off-by: Cyrill Leutwiler --- prdoc/pr_3154.prdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prdoc/pr_3154.prdoc b/prdoc/pr_3154.prdoc index 0e164d53f65d9..2dfc1b27810cf 100644 --- a/prdoc/pr_3154.prdoc +++ b/prdoc/pr_3154.prdoc @@ -1,8 +1,9 @@ -title: Contracts: Stabilize caller_is_root API +title: "Contracts: Stabilize caller_is_root API" doc: - audience: Runtime Dev description: | Removed the `#[unstable]` attrribute on `caller_is_root` host function. -crates: ["pallet-contracts"] +crates: + - name: pallet-contracts