Add erc165 tests

This commit is contained in:
lash 2023-06-09 09:49:05 +01:00
parent e73a258ce9
commit c7f88b71ce
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
6 changed files with 42 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

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

View File

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

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

View File

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