Contracts: Stabilize APIs (#3384)

Remove `#[unstable]` on `call_v2`, `instantiate_v2`,
`lock_delegate_dependency` and `unlock_delegate_dependency`.
See ink! integrations: 
- call_v2: https://github.com/paritytech/ink/pull/2077
- instantiate_v2: <TODO>
- lock/unlock dependency: https://github.com/paritytech/ink/pull/2076
This commit is contained in:
PG Herveou
2024-02-20 15:28:05 +01:00
committed by GitHub
parent e89d0fca35
commit d250a6e427
26 changed files with 137 additions and 140 deletions
+5 -15
View File
@@ -93,7 +93,7 @@ pub trait HostFn {
/// - `output`: A reference to the output data buffer to write the address.
fn address(output: &mut &mut [u8]);
/// Adds a new delegate dependency to the contract.
/// Lock a new delegate dependency to the contract.
///
/// Traps if the maximum number of delegate_dependencies is reached or if
/// the delegate dependency already exists.
@@ -102,10 +102,7 @@ pub trait HostFn {
///
/// - `code_hash`: The code hash of the dependency. Should be decodable as an `T::Hash`. Traps
/// otherwise.
#[deprecated(
note = "Unstable function. Behaviour can change without further notice. Use only for testing."
)]
fn add_delegate_dependency(code_hash: &[u8]);
fn lock_delegate_dependency(code_hash: &[u8]);
/// Stores the *free* balance of the current account into the supplied buffer.
///
@@ -142,6 +139,7 @@ pub trait HostFn {
///
/// Equivalent to the newer [`Self::call_v2`] version but works with
/// *ref_time* Weight only
#[deprecated(note = "Deprecated, use newer version instead")]
fn call_v1(
flags: CallFlags,
callee: &[u8],
@@ -178,9 +176,6 @@ pub trait HostFn {
/// - [CalleeTrapped][`crate::ReturnErrorCode::CalleeTrapped]
/// - [TransferFailed][`crate::ReturnErrorCode::TransferFailed]
/// - [NotCallable][`crate::ReturnErrorCode::NotCallable]
#[deprecated(
note = "Unstable function. Behaviour can change without further notice. Use only for testing."
)]
fn call_v2(
flags: CallFlags,
callee: &[u8],
@@ -480,6 +475,7 @@ pub trait HostFn {
///
/// Equivalent to the newer [`Self::instantiate_v2`] version but works
/// with *ref_time* Weight only.
#[deprecated(note = "Deprecated, use newer version instead")]
fn instantiate_v1(
code_hash: &[u8],
gas: u64,
@@ -524,9 +520,6 @@ pub trait HostFn {
/// - [CalleeTrapped][`crate::ReturnErrorCode::CalleeTrapped]
/// - [TransferFailed][`crate::ReturnErrorCode::TransferFailed]
/// - [CodeNotFound][`crate::ReturnErrorCode::CodeNotFound]
#[deprecated(
note = "Unstable function. Behaviour can change without further notice. Use only for testing."
)]
fn instantiate_v2(
code_hash: &[u8],
ref_time_limit: u64,
@@ -602,10 +595,7 @@ pub trait HostFn {
///
/// - `code_hash`: The code hash of the dependency. Should be decodable as an `T::Hash`. Traps
/// otherwise.
#[deprecated(
note = "Unstable function. Behaviour can change without further notice. Use only for testing."
)]
fn remove_delegate_dependency(code_hash: &[u8]);
fn unlock_delegate_dependency(code_hash: &[u8]);
/// Cease contract execution and save a data buffer as a result of the execution.
///