code:
from web3 import Web3, EthereumTesterProvider
from eth_tester import EthereumTester, MockBackend, PyEVMBackend
w3 = Web3(EthereumTesterProvider(EthereumTester(MockBackend())))
print(w3.is_connected())
print(w3.eth.accounts)
acct_one = w3.eth.accounts[0]
print(w3.eth.get_balance(acct_one))
acct_two = w3.eth.account.create()
print(acct_two.address)
tx_hash = w3.eth.send_transaction({
'from': acct_one,
'to': acct_two.address,
'value': w3.to_wei(1, 'ether'),
'gas': 2000
})
w3.eth.wait_for_transaction_receipt(tx_hash)
print(w3.eth.get_balance(acct_one))
print(w3.eth.get_balance(acct_two.address))
result: True ['0xaBbACadABa000000000000000000000000000000', '0xaBbACaDaBA000000000000000000000000000001', '0xAbbAcaDaBA000000000000000000000000000002', '0xabBACadaBA000000000000000000000000000003', '0xabbAcADABa000000000000000000000000000004', '0xaBBACADABA000000000000000000000000000005', '0xaBbaCadaBA000000000000000000000000000006', '0xAbbAcAdaBA000000000000000000000000000007', '0xaBBAcadabA000000000000000000000000000008', '0xABbacaDabA000000000000000000000000000009'] 1000000000000000000000000 0x239296890d8444204Fba6F19d2CFA2C1C75e7c62 1000000000000000000000000 0
Use a test account to make the transfer in EthereumTester