Bump version

This commit is contained in:
lash 2023-03-20 10:50:11 +00:00
parent 86652cc5f0
commit 6a6ffc97d0
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
4 changed files with 12 additions and 3 deletions

View File

@ -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

View File

@ -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()

View File

@ -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)

View File

@ -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;
}
}