mirror of
git://holbrook.no/eth-faucet
synced 2025-01-08 10:07:32 +01:00
Merge branch 'master' into lash/period
This commit is contained in:
commit
80fb3c98b5
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ build/
|
|||||||
dist/
|
dist/
|
||||||
solidity/*.json
|
solidity/*.json
|
||||||
solidity/*.bin
|
solidity/*.bin
|
||||||
|
.venv
|
@ -1,2 +1,2 @@
|
|||||||
chainlib-eth~=0.4.8
|
chainlib-eth~=0.4.8
|
||||||
erc20-faucet̃~=0.5.0
|
erc20-faucet~=0.5.0
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
eth_tester==0.5.0b3
|
eth_tester==0.5.0b3
|
||||||
py-evm==0.3.0a20
|
py-evm==0.3.0a20
|
||||||
accounts_index~=0.3.0
|
eth-accounts-index~=0.3.0
|
||||||
|
@ -146,6 +146,28 @@ class TestFaucet(EthTesterCase):
|
|||||||
r = self.conn.do(o)
|
r = self.conn.do(o)
|
||||||
self.assertEqual(int(r, 16), prebalance - cost + 1000)
|
self.assertEqual(int(r, 16), prebalance - cost + 1000)
|
||||||
|
|
||||||
|
def test_payable_with_tx_data(self):
|
||||||
|
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
|
||||||
|
c = EthFaucet(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
|
||||||
|
|
||||||
|
o = balance(self.accounts[0])
|
||||||
|
r = self.conn.do(o)
|
||||||
|
prebalance = int(r, 16)
|
||||||
|
|
||||||
|
gas_price = 1000000000
|
||||||
|
contract_gas_oracle = OverrideGasOracle(limit=21055, price=gas_price, conn=self.conn)
|
||||||
|
cg = Gas(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle, gas_oracle=contract_gas_oracle)
|
||||||
|
(tx_hash_hex, o) = cg.create(self.accounts[0], self.address, 1000, data='0x0')
|
||||||
|
self.conn.do(o)
|
||||||
|
|
||||||
|
o = receipt(tx_hash_hex)
|
||||||
|
r = self.conn.do(o)
|
||||||
|
cost = r['gas_used'] * gas_price
|
||||||
|
self.assertEqual(r['status'], 0)
|
||||||
|
|
||||||
|
o = balance(self.accounts[0])
|
||||||
|
r = self.conn.do(o)
|
||||||
|
self.assertEqual(int(r, 16), prebalance - cost)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user