pub fn mint(&mut self, address: H160, eth_amount: U256) -> Result<(), MintError> {
        let (balance, nonce) = match self.account_info(address) {
            Some(account) => {
                let balance = account
                    .balance
                    .checked_add(eth_amount)
                    .ok_or(MintError::BalanceOverflow)?;
                let nonce = account.nonce; // REVIEW: should the nonce be incremented?

                (balance, nonce)
            }
            None => (eth_amount, U256::from(0)),
        };

        self.storage_backend.apply(
            [Apply::Modify {
                address,
                basic: Basic { balance, nonce },
                code: None,
                storage: [],
                reset_storage: false,
            }],
            [],
            false,
        );

        Ok(())
    }
/// Add balance to the specified account.
/// Intended to used for testing.
///
/// Note: this will create a new account at the given address if one does not exist.
Add balance to the specified account.
Intended to used for testing.

this will create a new account at the given address if one does not exist.
Add balance to the specified account . Intended to used for testing . this will create a new account at the given address if one does not exist .
pub fn mint(&mut self, address: H160, eth_amount: U256) -> Result<(), MintError> {
        let (balance, nonce) = match self.account_info(address) {
            Some(account) => {
                let balance = account
                    .balance
                    .checked_add(eth_amount)
                    .ok_or(MintError::BalanceOverflow)?;
                let nonce = account.nonce; // REVIEW: should the nonce be incremented?
                (balance, nonce)
            }
            None => (eth_amount, U256::from(0)),
        };
        self.storage_backend.apply(
            [Apply::Modify {
                address,
                basic: Basic { balance, nonce },
                code: None,
                storage: [],
                reset_storage: false,
            }],
            [],
            false,
        );
        Ok(())
    }
pub fn mint ( & mut self , address : H160 , eth_amount : U256 ) -> Result < ( ) , MintError > { let ( balance , nonce ) = match self . account_info ( address ) { Some ( account ) => { let balance = account . balance . checked_add ( eth_amount ) . ok_or ( MintError :: BalanceOverflow ) ? ; let nonce = account . nonce ; // REVIEW: should the nonce be incremented? ( balance , nonce ) } None => ( eth_amount , U256 :: from ( 0 ) ) , } ; self . storage_backend . apply ( [ Apply :: Modify { address , basic : Basic { balance , nonce } , code : None , storage : [ ] , reset_storage : false , } ] , [ ] , false , ) ; Ok ( ( ) ) }
Add balance to the specified account.
Add balance to the specified account .
&mut self
address
H160
eth_amount
U256