Contracts: Stabilize caller_is_root API (#3154)

Can this API be marked stable? Implemented in [solang
here](https://github.com/hyperledger/solang/pull/1620)

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2024-02-03 12:50:55 +01:00
committed by GitHub
parent e349fc9ef8
commit 966a886439
3 changed files with 9 additions and 4 deletions
+9
View File
@@ -0,0 +1,9 @@
title: "Contracts: Stabilize caller_is_root API"
doc:
- audience: Runtime Dev
description: |
Removed the `#[unstable]` attrribute on `caller_is_root` host function.
crates:
- name: pallet-contracts
@@ -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<u32, TrapReason> {
ctx.charge_gas(RuntimeCosts::CallerIsRoot)?;
Ok(ctx.ext.caller_is_root() as u32)
@@ -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.