9 from os.path
import join
10 from unittest
import TestCase
11 from typing
import Any
13 CONTRACT_INSTANCE: Any =
None
16 Test data here matches that used in test_mimc.py, which is also used in the
17 tests of mimc circuits.
27 contract_instance_desc = InstanceDescription.deploy(
29 join(contracts_dir,
"TestMiMC.sol"),
34 {
"allow_paths": contracts_dir})
35 global CONTRACT_INSTANCE
36 CONTRACT_INSTANCE = contract_instance_desc.instantiate(web3)
40 x =
int(28948022309329048855892746252171976963317496166410141009864396001978282409983).to_bytes(32,
'big')
41 y =
int(14220067918847996031108144435763672811050758065945364308986253046354060608451).to_bytes(32,
'big')
45 result = CONTRACT_INSTANCE.functions.testMimcAltBN128(x, y).call()
46 self.assertEqual(h, result)
50 x =
int(28948022309329048855892746252171976963317496166410141009864396001978282409983).to_bytes(32,
'big')
51 y =
int(14220067918847996031108144435763672811050758065945364308986253046354060608451).to_bytes(32,
'big')
55 result = CONTRACT_INSTANCE.functions.testMimcBLS12_377(x, y).call()
56 self.assertEqual(h, result)