Add erc165 tests
This commit is contained in:
parent
e73a258ce9
commit
c7f88b71ce
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,5 @@
|
|||||||
eth_tester==0.5.0b3
|
eth_tester==0.5.0b3
|
||||||
py-evm==0.3.0a20
|
py-evm==0.3.0a20
|
||||||
pytest==6.0.1
|
pytest==6.0.1
|
||||||
cic-contracts~=0.3.6
|
cic-contracts~=0.3.8
|
||||||
|
eth-interface~=0.1.2
|
||||||
|
@ -9,6 +9,7 @@ from chainlib.eth.block import block_by_number
|
|||||||
from eth_burner.unittest import TestEthBurnerInterface
|
from eth_burner.unittest import TestEthBurnerInterface
|
||||||
from eth_burner.unittest.base import TestEthBurner
|
from eth_burner.unittest.base import TestEthBurner
|
||||||
from ge_capped_token.unittest import TestCappedToken
|
from ge_capped_token.unittest import TestCappedToken
|
||||||
|
from cic_contracts import erc165_for
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
logg = logging.getLogger()
|
logg = logging.getLogger()
|
||||||
|
34
python/tests/test_erc165.py
Normal file
34
python/tests/test_erc165.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# standard imports
|
||||||
|
import unittest
|
||||||
|
import logging
|
||||||
|
|
||||||
|
# external imports
|
||||||
|
from cic_contracts import erc165_for
|
||||||
|
from eth_interface.unittest import TestERC165
|
||||||
|
|
||||||
|
# local imports
|
||||||
|
from ge_capped_token.unittest import TestCappedToken
|
||||||
|
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
logg = logging.getLogger()
|
||||||
|
|
||||||
|
|
||||||
|
class TestEthCappedBurner(TestCappedToken, TestERC165):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
super(TestEthCappedBurner, self).setUp()
|
||||||
|
for v in [
|
||||||
|
# 'Minter',
|
||||||
|
'Burner',
|
||||||
|
'Capped',
|
||||||
|
'Writer',
|
||||||
|
'Expire',
|
||||||
|
'ERC20',
|
||||||
|
]:
|
||||||
|
ifc = erc165_for(v)
|
||||||
|
logg.debug('add interface check {} -> {}'.format(v, ifc))
|
||||||
|
self.add_interface_check(ifc)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
@ -271,6 +271,9 @@ contract CappedToken {
|
|||||||
if (_sum == 0x841a0e94) { // Expire
|
if (_sum == 0x841a0e94) { // Expire
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (_sum == 0x869f7594) { // Capped
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user