Commit a3ad0f9c authored by Andrew Jones's avatar Andrew Jones

Remove all printlns

parent a9ca64e5
Pipeline #69590 failed with stages
in 12 minutes and 29 seconds
......@@ -54,26 +54,10 @@ mod runtime {
/// Returns the account balance, read directly from runtime storage
#[ink(message)]
fn get_balance(&self, account: AccountId) -> Balance {
self.env().println(&format!("Getting balance for account {:?}", account.encode()));
const BALANCE_OF: &[u8] = b"Balances FreeBalance";
let unhashed = account.to_keyed_vec(BALANCE_OF);
self.env().println(&format!("Unhashed key {:?}", unhashed));
let key = crypto::blake2_256(&unhashed);
self.env().println(&format!("Calculated key {:?}", key));
let key = crypto::blake2_256(&account.to_keyed_vec(BALANCE_OF));
let result = self.env().get_runtime_storage::<Balance>(&key[..]);
match result {
Ok(balance) => {
self.env().println("get_runtime_storage: Read balance Ok");
balance
},
Err(err) => {
self.env().println(&format!("Error reading runtime storage {:?}", err));
0
},
}
result.unwrap_or_default()
}
}
......
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