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

Function it_increments_a_nonce

chain/src/account.rs:157–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155
156 #[test]
157 fn it_increments_a_nonce() {
158 let mut account_storage = new_account_storage();
159 let (_, id) = add_account(&mut account_storage);
160 let reteived_account_data = account_storage.get_account(&id).unwrap();
161 assert_eq!(reteived_account_data.nonce, U256::zero());
162
163 let next_nonce = U256::from(1);
164 account_storage.update_nonce(&id, next_nonce).unwrap();
165 let reteived_account_data = account_storage.get_account(&id).unwrap();
166 assert_eq!(reteived_account_data.nonce, next_nonce);
167 }
168
169 #[test]
170 fn it_transfers() {

Callers

nothing calls this directly

Calls 4

new_account_storageFunction · 0.85
add_accountFunction · 0.85
get_accountMethod · 0.80
update_nonceMethod · 0.80

Tested by

no test coverage detected