diff --git a/integration_tests/test_e2ee.py b/integration_tests/test_e2ee.py index 752abc4a66..9a8ae989f6 100644 --- a/integration_tests/test_e2ee.py +++ b/integration_tests/test_e2ee.py @@ -1,19 +1,22 @@ -import json - -from .utils import prepare_cipherfile, wait_for_new_blocks - - def test_encrypt_decrypt(cronos): - cli = cronos.cosmos_cli() + cli0 = cronos.cosmos_cli() cli1 = cronos.cosmos_cli(1) + + # gen two keys for two accounts name0 = "key0" name1 = "key1" + pubkey0 = cli0.keygen(keyring_name=name0) + pubkey1 = cli1.keygen(keyring_name=name1) + sender = "validator" + cli0.register_e2ee_key(pubkey0, _from=sender) + cli1.register_e2ee_key(pubkey1, _from=sender) + # query in batch + assert cli0.query_e2ee_keys(cli0.address(sender), cli1.address(sender)) == [ + pubkey0, + pubkey1, + ] + # prepare data file to encrypt content = "Hello World!" - cipherfile = prepare_cipherfile(cli, cli1, name0, name1, content) - assert cli.decrypt(cipherfile, identity=name0) == content - assert cli1.decrypt(cipherfile, identity=name1) == content - - def test_block_list(cronos): cli0 = cronos.cosmos_cli() cli1 = cronos.cosmos_cli(1) diff --git a/integration_tests/test_gov_update_params.py b/integration_tests/test_gov_update_params.py index 8234292d1b..03539531b1 100644 --- a/integration_tests/test_gov_update_params.py +++ b/integration_tests/test_gov_update_params.py @@ -9,7 +9,6 @@ approve_proposal, deploy_contract, eth_to_bech32, - prepare_cipherfile, wait_for_new_blocks, wait_for_port, ) diff --git a/integration_tests/utils.py b/integration_tests/utils.py index fd9cfb933b..323207d83e 100644 --- a/integration_tests/utils.py +++ b/integration_tests/utils.py @@ -732,28 +732,3 @@ def get_send_enable(port): url = f"http://127.0.0.1:{port}/cosmos/bank/v1beta1/params" raw = requests.get(url).json() return raw["params"]["send_enabled"] - - -def prepare_cipherfile(cli0, cli1, name0, name1, content): - # gen two keys for two accounts - pubkey0 = cli0.keygen(keyring_name=name0) - pubkey1 = cli1.keygen(keyring_name=name1) - sender = "validator" - cli0.register_e2ee_key(pubkey0, _from=sender) - cli1.register_e2ee_key(pubkey1, _from=sender) - # query in batch - assert cli0.query_e2ee_keys(cli0.address(sender), cli1.address(sender)) == [ - pubkey0, - pubkey1, - ] - # prepare data file to encrypt - plainfile = cli0.data_dir / "plaintext" - plainfile.write_text(content) - cipherfile = cli0.data_dir / "ciphertext" - cli0.encrypt( - plainfile, - cli0.address(sender), - cli1.address(sender), - output=cipherfile, - ) - return cipherfile