Contracts: Fix legacy uapi (#3994)

Fix some broken legacy definitions of pallet_contracts_uapi storage host
functions
This commit is contained in:
PG Herveou
2024-04-10 07:05:21 +02:00
committed by GitHub
parent df818d2974
commit 2d927b0772
5 changed files with 112 additions and 131 deletions
@@ -59,7 +59,7 @@ mod sys {
pub fn caller_is_root() -> ReturnCode;
pub fn clear_storage(key_ptr: *const u8, key_len: u32) -> ReturnCode;
pub fn clear_storage(key_ptr: *const u8);
pub fn code_hash(
account_id_ptr: *const u8,
@@ -67,7 +67,7 @@ mod sys {
output_len_ptr: *mut u32,
) -> ReturnCode;
pub fn contains_storage(key_ptr: *const u8, key_len: u32) -> ReturnCode;
pub fn contains_storage(key_ptr: *const u8) -> ReturnCode;
pub fn debug_message(str_ptr: *const u8, str_len: u32) -> ReturnCode;
@@ -599,7 +599,7 @@ impl HostFn for HostFnImpl {
}
fn clear_storage(key: &[u8]) {
unsafe { sys::clear_storage(key.as_ptr(), key.len() as u32) };
unsafe { sys::clear_storage(key.as_ptr()) };
}
fn clear_storage_v1(key: &[u8]) -> Option<u32> {
@@ -656,7 +656,7 @@ impl HostFn for HostFnImpl {
}
fn contains_storage(key: &[u8]) -> Option<u32> {
let ret_code = unsafe { sys::contains_storage(key.as_ptr(), key.len() as u32) };
let ret_code = unsafe { sys::contains_storage(key.as_ptr()) };
ret_code.into()
}