Remove randbytes from eth tests

This commit is contained in:
nolash 2021-11-29 15:44:09 +01:00
parent e7fcde7530
commit 8f78e80bb1
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 20 additions and 13 deletions

View File

@ -23,7 +23,7 @@ licence_files =
[options]
python_requires = >= 3.6
python_requires = >= 3.8
include_package_data = True
packages =
cic

View File

@ -36,18 +36,18 @@ class TestCICBase(unittest.TestCase):
for i in range(3):
address_bytes = f.read(32)
addresses.append(add_0x(address_bytes.hex()))
f.close()
# addresses = [
# add_0x(random.randbytes(20).hex()),
# add_0x(random.randbytes(20).hex()),
# add_0x(random.randbytes(20).hex()),
# ]
self.token_symbol = 'FOO'
self.token_address = add_0x(random.randbytes(32).hex())
self.token_index_address = add_0x(random.randbytes(32).hex())
self.address_declarator_address = add_0x(random.randbytes(32).hex())
token_address_bytes = f.read(20)
token_index_address_bytes = f.read(20)
address_declarator_address_bytes = f.read(20)
self.token_address = add_0x(token_address_bytes.hex())
self.token_index_address = add_0x(token_index_address_bytes.hex())
self.address_declarator_address = add_0x(address_declarator_address_bytes.hex())
f.close()
self.outputs_dir = tempfile.mkdtemp()
self.outputs_writer = KVWriter(self.outputs_dir)

View File

@ -41,8 +41,15 @@ class TestCICEthBase(EthTesterCase):
def setUp(self):
super(TestCICEthBase, self).setUp()
random.seed(42)
self.initial_description = add_0x(random.randbytes(32).hex())
self.token_address = add_0x(random.randbytes(20).hex())
f = open('/dev/urandom', 'rb')
#self.initial_description = add_0x(random.randbytes(32).hex())
#self.token_address = add_0x(random.randbytes(20).hex())
initial_description_bytes = f.read(32)
self.initial_description = add_0x(initial_description_bytes.hex())
token_address_bytes = f.read(20)
self.token_address = add_0x(token_address_bytes.hex())
f.close()
addresses = self.keystore.list()