mirror of
git://holbrook.no/eth-faucet
synced 2026-04-28 02:41:03 +02:00
Merge branch 'tmp' into dev-0.2.0
This commit is contained in:
@@ -206,5 +206,35 @@ class TestFaucetPeriod(EthTesterCase):
|
||||
self.assertEqual(r['status'], 1)
|
||||
|
||||
|
||||
def test_period_front(self):
|
||||
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
|
||||
c = TxFactory(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('setPeriod')
|
||||
enc.typ(ABIContractType.UINT256)
|
||||
enc.uint256(100)
|
||||
data = enc.get()
|
||||
tx = c.template(self.accounts[0], self.period_store_address, use_nonce=True)
|
||||
tx = c.set_code(tx, data)
|
||||
(tx_hash_hex, o) = c.finalize(tx)
|
||||
self.conn.do(o)
|
||||
|
||||
nonce_oracle = RPCNonceOracle(self.accounts[0], self.conn)
|
||||
c = EthFaucet(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
|
||||
(tx_hash_hex, o) = c.gimme(self.address, self.accounts[0])
|
||||
self.conn.do(o)
|
||||
o = receipt(tx_hash_hex)
|
||||
r = self.conn.do(o)
|
||||
o = block_by_number(r['block_number'])
|
||||
r = self.conn.do(o)
|
||||
thistime = r['timestamp']
|
||||
|
||||
o = c.next_time(self.address, self.accounts[0], sender_address=self.accounts[0])
|
||||
r = self.conn.do(o)
|
||||
nexttime = int(r, 16)
|
||||
|
||||
self.assertEqual(nexttime, thistime+100)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user