MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / add_account

Function add_account

chain/src/account.rs:140–146  ·  view source on GitHub ↗
(account_storage: &mut AccountStorage)

Source from the content-addressed store, hash-verified

138 }
139
140 fn add_account(account_storage: &mut AccountStorage) -> (AccountData, H160) {
141 let account_data = AccountData::new(None);
142 let key = Account::random();
143 account_storage.add_account(&key, &account_data).unwrap();
144
145 (account_data, key)
146 }
147
148 #[test]
149 fn it_adds_and_gets_an_account() {

Callers 4

it_increments_a_nonceFunction · 0.85
it_transfersFunction · 0.85
root_hash_changesFunction · 0.85

Calls 1

add_accountMethod · 0.80

Tested by 4

it_increments_a_nonceFunction · 0.68
it_transfersFunction · 0.68
root_hash_changesFunction · 0.68