Skip to content

Commit 966a886

Browse files
authored
Contracts: Stabilize caller_is_root API (#3154)
Can this API be marked stable? Implemented in [solang here](hyperledger-solang/solang#1620) --------- Signed-off-by: Cyrill Leutwiler <[email protected]>
1 parent e349fc9 commit 966a886

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

prdoc/pr_3154.prdoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: "Contracts: Stabilize caller_is_root API"
2+
3+
doc:
4+
- audience: Runtime Dev
5+
description: |
6+
Removed the `#[unstable]` attrribute on `caller_is_root` host function.
7+
8+
crates:
9+
- name: pallet-contracts

substrate/frame/contracts/src/wasm/runtime.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,6 @@ pub mod env {
15421542

15431543
/// Checks whether the caller of the current contract is root.
15441544
/// See [`pallet_contracts_uapi::HostFn::caller_is_root`].
1545-
#[unstable]
15461545
fn caller_is_root(ctx: _, _memory: _) -> Result<u32, TrapReason> {
15471546
ctx.charge_gas(RuntimeCosts::CallerIsRoot)?;
15481547
Ok(ctx.ext.caller_is_root() as u32)

substrate/frame/contracts/uapi/src/host.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ pub trait HostFn {
277277
///
278278
/// A return value of `true` indicates that this contract is being called by a root origin,
279279
/// and `false` indicates that the caller is a signed origin.
280-
#[deprecated(
281-
note = "Unstable function. Behaviour can change without further notice. Use only for testing."
282-
)]
283280
fn caller_is_root() -> u32;
284281

285282
/// Clear the value at the given key in the contract storage.

0 commit comments

Comments
 (0)