mirror of
git://holbrook.no/eth-faucet
synced 2024-12-04 20:46:10 +01:00
Bump version
This commit is contained in:
parent
86652cc5f0
commit
6a6ffc97d0
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = eth-faucet
|
||||
version = 0.1.2
|
||||
version = 0.2.0
|
||||
description = Gas token gifter with controls from time intervals, amounts and access.
|
||||
author = Louis Holbrook
|
||||
author_email = dev@holbrook.no
|
||||
|
@ -232,9 +232,13 @@ class TestFaucetPeriod(EthTesterCase):
|
||||
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)
|
||||
|
||||
o = c.check(self.address, self.accounts[0], sender_address=self.accounts[0])
|
||||
r = self.conn.do(o)
|
||||
checked = int(r, 16)
|
||||
self.assertEqual(checked, 0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -109,6 +109,10 @@ class TestFaucetRegistry(EthTesterCase):
|
||||
c = EthFaucet(self.chain_spec, signer=self.signer, nonce_oracle=nonce_oracle)
|
||||
o = c.check(self.address, self.accounts[2], sender_address=self.accounts[0])
|
||||
r = self.conn.do(o)
|
||||
self.assertEqual(int(r, 16), 0)
|
||||
|
||||
o = c.check(self.address, self.accounts[1], sender_address=self.accounts[0])
|
||||
r = self.conn.do(o)
|
||||
self.assertEqual(int(r, 16), 1)
|
||||
|
||||
|
||||
|
@ -46,9 +46,10 @@ contract PeriodSimple {
|
||||
return block.timestamp > this.next(_subject);
|
||||
}
|
||||
|
||||
function poke(address _subject) external {
|
||||
function poke(address _subject) external returns(bool) {
|
||||
require(msg.sender == owner || msg.sender == poker, 'ERR_ACCESS');
|
||||
require(this.check(_subject), 'ERR_PREMATURE');
|
||||
lastUsed[_subject] = block.timestamp;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user