Commit 866d2bed authored by Andrew Jones's avatar Andrew Jones

Rename to match substrate ext function

parent 32f12af6
Pipeline #64719 failed with stages
in 10 minutes and 39 seconds
......@@ -248,7 +248,7 @@ where
fn runtime_get_storage<U: Decode>(key: &[u8]) -> Option<Result<U, scale::Error>> {
const SUCCESS: u32 = 0;
let result = unsafe { sys::ext_runtime_get_storage(key.as_ptr() as u32, key.len() as u32) };
let result = unsafe { sys::ext_get_runtime_storage(key.as_ptr() as u32, key.len() as u32) };
if result == SUCCESS {
return Some(U::decode(&mut &read_scratch_buffer()[..]))
}
......
......@@ -84,7 +84,7 @@ extern "C" {
/// Tells the execution environment to load the contents
/// stored in the runtime storage at the given key into the scratch buffer.
pub fn ext_runtime_get_storage(key_ptr: u32, key_len: u32) -> u32;
pub fn ext_get_runtime_storage(key_ptr: u32, key_len: u32) -> u32;
/// Returns the length in bytes of the scratch buffer.
pub fn ext_scratch_size() -> u32;
......
......@@ -88,7 +88,7 @@ pub fn get_storage(key: &[u8]) -> RetCode {
}
pub fn runtime_get_storage(key: &[u8]) -> RetCode {
unsafe { sys::ext_runtime_get_storage(key.as_ptr() as u32, key.len() as u32) }.into()
unsafe { sys::ext_get_runtime_storage(key.as_ptr() as u32, key.len() as u32) }.into()
}
pub fn restore_to(
......@@ -204,7 +204,7 @@ mod sys {
);
pub fn ext_get_storage(key_ptr: u32) -> u32;
pub fn ext_runtime_get_storage(key_ptr: u32, key_len: u32) -> u32;
pub fn ext_get_runtime_storage(key_ptr: u32, key_len: u32) -> u32;
pub fn ext_restore_to(
dest_ptr: u32,
......
......@@ -30,8 +30,7 @@ mod runtime {
impl RuntimeStorage {
#[ink(constructor)]
fn default(&mut self) {
}
fn new(&mut self) {}
/// Returns the account balance, read directly from runtime storage
#[ink(message)]
......@@ -48,14 +47,14 @@ mod runtime {
}
}
#[cfg(all(test))]
mod tests {
use super::*;
#[test]
fn it_works() {
// let contract = RuntimeStorage::default();
// #[cfg(all(test))]
// mod tests {
// use super::*;
//
// #[test]
// fn it_works() {
// let contract = RuntimeStorage::new();
// assert_eq!(contract.get_balance(), false);
}
}
// }
// }
}
Markdown is supported
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