9 decode_encryption_secret_key, decode_encryption_public_key
13 from os.path
import join
14 from typing
import Dict, List, Tuple, Optional, Any
18 TEST_PROVER_SERVER_ENDPOINT: str =
"localhost:50051"
19 TEST_WEB3_PROVIDER_ENDPOINT: str =
"http://localhost:8545"
20 TEST_NOTE_DIR: str =
"_test_notes"
22 KeyStore = Dict[str, ZethAddress]
26 web3 =
open_web3(TEST_WEB3_PROVIDER_ENDPOINT)
32 Keystore for the tests
35 alice_25519_enc_private_key = \
36 b
'\xde\xa2\xc1\x0b\xd1\xf7\x13\xf8J\xa4:\xa4\xb6\xfa\xbd\xd5\xc9' + \
37 b
'\x8a\xd9\xb6\xb4\xc4\xc4I\x88\xa4\xd9\xe2\xee\x9e\x9a\xff'
38 alice_25519_enc_public_key = \
39 b
'\x1eO"\n\xdaWnU+\xf5\xaa\x8a#\xd2*\xd3\x11\x9fc\xe52 \xd8^\xbc-' + \
42 bob_25519_enc_private_key = \
43 b
'\xd3\xf0\x8f ,\x1d#\xdc\xac,\x93\xbd\xd0\xd9\xed\x8c\x92\x822' + \
44 b
'\xef\xd6\x97^\x86\xf7\xe4/\x85\xb6\x10\xe6o'
45 bob_25519_enc_public_key = \
46 b
't\xc5{5j\xb5\x8a\xd3n\xb3\xab9\xe8s^13\xba\xa2\x91x\xb01(\xf9' + \
49 charlie_25519_enc_private_key = b
'zH\xb66q\x97\x0bO\xcb\xb9q\x9b\xbd-1`I' + \
50 b
'\xae\x00-\x11\xb9\xed}\x18\x9f\xf6\x8dr\xaa\xd4R'
51 charlie_25519_enc_public_key = \
52 b
'u\xe7\x88\x9c\xbfE(\xf8\x99\xca<\xa8[<\xa2\x88m\xad\rN"\xf0}' + \
53 b
'\xec\xfcB\x89\xe6\x96\xcf\x19U'
74 "Alice": ZethAddress.from_key_pairs(
75 alice_ownership, alice_encryption),
76 "Bob": ZethAddress.from_key_pairs(
77 bob_ownership, bob_encryption),
78 "Charlie": ZethAddress.from_key_pairs(
79 charlie_ownership, charlie_encryption),
87 "6461f753bfe21ba2219ced74875b8dbd8c114c3c79d7e41306dd82118de1895b"
88 for _
in range(length):
89 mk_path.append(dummy_node)
95 deployer_address: str,
97 constructor_args: Optional[Dict[str, Any]] =
None) -> Tuple[Any, Any]:
99 sol_path = join(contracts_dir, contract_name +
".sol")
101 interface = compiled_sol[sol_path +
":" + contract_name]
102 contract_abi = interface[
'abi']
103 contract = eth.contract(abi=contract_abi, bytecode=interface[
'bin'])
104 deploy_tx = contract.constructor(**constructor_args)
105 deploy_tx_hash = deploy_tx.transact({
'from': deployer_address})
106 tx_receipt = eth.waitForTransactionReceipt(deploy_tx_hash, 1000)
107 contract_address = tx_receipt[
'contractAddress']
108 contract_instance = eth.contract(
109 address=contract_address,
111 return interface, contract_instance