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

TEMPORARY: diagnostic logging

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