Commit 14bfc6e2 authored by Andrew Jones's avatar Andrew Jones
Browse files

TEMPORARY: diagnostic logging

parent 2618fb4a
Pipeline #69443 failed with stages
in 11 minutes and 10 seconds
...@@ -333,6 +333,7 @@ where ...@@ -333,6 +333,7 @@ where
where where
R: scale::Decode, R: scale::Decode,
{ {
self.println("mutable::get_runtime_storage");
T::get_runtime_storage(&mut self.buffer, key) T::get_runtime_storage(&mut self.buffer, key)
} }
} }
...@@ -419,10 +419,13 @@ where ...@@ -419,10 +419,13 @@ where
I: AsMut<[u8]> + EnlargeTo, I: AsMut<[u8]> + EnlargeTo,
R: scale::Decode, R: scale::Decode,
{ {
Self::println("get_runtime_storage");
let ret = ext::get_runtime_storage(key); let ret = ext::get_runtime_storage(key);
if !ret.is_success() { if !ret.is_success() {
Self::println("get_runtime_storage: is_success == false");
return Err(Error::InvalidStorageKey) return Err(Error::InvalidStorageKey)
} }
Self::println("get_runtime_storage: is_success == true");
let req_len = ext::scratch_size(); let req_len = ext::scratch_size();
buffer.enlarge_to(req_len); buffer.enlarge_to(req_len);
let ret = ext::scratch_read(&mut buffer.as_mut()[0..req_len], 0); let ret = ext::scratch_read(&mut buffer.as_mut()[0..req_len], 0);
......
...@@ -35,8 +35,10 @@ mod runtime { ...@@ -35,8 +35,10 @@ mod runtime {
/// Returns the account balance, read directly from runtime storage /// Returns the account balance, read directly from runtime storage
#[ink(message)] #[ink(message)]
fn get_balance(&self, account: AccountId) -> Balance { fn get_balance(&self, account: AccountId) -> Balance {
self.env().println("get_balance");
const BALANCE_OF: &[u8] = b"balance:"; const BALANCE_OF: &[u8] = b"balance:";
let key = account.to_keyed_vec(BALANCE_OF); let key = account.to_keyed_vec(BALANCE_OF);
self.env().println("constructed key");
match self.env().get_runtime_storage::<Balance>(&key) { match self.env().get_runtime_storage::<Balance>(&key) {
Ok(balance) => { Ok(balance) => {
self.env().println("get_runtime_storage: Read balance Ok"); self.env().println("get_runtime_storage: Read balance Ok");
......
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