Unverified Commit 24109d05 authored by Hero Bird's avatar Hero Bird Committed by GitHub
Browse files

[core] implement split of ext_set_storage (#344)

This implements the ink! side implementation of Substrate PR #5103:
https://github.com/paritytech/substrate/pull/5103
parent 00758069
Pipeline #82615 passed with stages
in 10 minutes and 10 seconds
...@@ -54,12 +54,8 @@ mod sys { ...@@ -54,12 +54,8 @@ mod sys {
data_len: u32, data_len: u32,
); );
pub fn ext_set_storage( pub fn ext_set_storage(key_ptr: u32, value_ptr: u32, value_len: u32);
key_ptr: u32, pub fn ext_clear_storage(key_ptr: u32);
value_non_null: u32,
value_ptr: u32,
value_len: u32,
);
pub fn ext_get_storage(key_ptr: u32) -> u32; pub fn ext_get_storage(key_ptr: u32) -> u32;
pub fn ext_get_runtime_storage(key_ptr: u32, key_len: u32) -> u32; pub fn ext_get_runtime_storage(key_ptr: u32, key_len: u32) -> u32;
...@@ -160,7 +156,6 @@ pub fn set_storage(key: &[u8], encoded_value: &[u8]) { ...@@ -160,7 +156,6 @@ pub fn set_storage(key: &[u8], encoded_value: &[u8]) {
unsafe { unsafe {
sys::ext_set_storage( sys::ext_set_storage(
key.as_ptr() as u32, key.as_ptr() as u32,
1,
encoded_value.as_ptr() as u32, encoded_value.as_ptr() as u32,
encoded_value.len() as u32, encoded_value.len() as u32,
) )
...@@ -168,7 +163,7 @@ pub fn set_storage(key: &[u8], encoded_value: &[u8]) { ...@@ -168,7 +163,7 @@ pub fn set_storage(key: &[u8], encoded_value: &[u8]) {
} }
pub fn clear_storage(key: &[u8]) { pub fn clear_storage(key: &[u8]) {
unsafe { sys::ext_set_storage(key.as_ptr() as u32, 0, 0, 0) } unsafe { sys::ext_clear_storage(key.as_ptr() as u32) }
} }
pub fn get_storage(key: &[u8]) -> Result<()> { pub fn get_storage(key: &[u8]) -> Result<()> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment