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

Method transfer

chain/src/account.rs:82–87  ·  view source on GitHub ↗
(&mut self, from: &Account, to: &Account, amount: U256)

Source from the content-addressed store, hash-verified

80 }
81
82 pub(crate) fn transfer(&mut self, from: &Account, to: &Account, amount: U256) -> Result<()> {
83 self.subtract_account_balance(from, amount)?;
84 self.add_account_balance(to, amount)?;
85
86 Ok(())
87 }
88
89 // TODO(ddimaria): remove
90 pub(crate) fn update_nonce(&mut self, key: &Account, nonce: U256) -> Result<U256> {

Callers 1

process_transactionMethod · 0.45

Calls 2

add_account_balanceMethod · 0.80

Tested by

no test coverage detected