From db6781c5cceaaf4bf81caa7f25b7d51be6c5e971 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Mas=C5=82owski?= <rmaslowski@syncad.com>
Date: Fri, 23 Aug 2024 09:59:09 +0200
Subject: [PATCH] Make test_creation_of_huge_number_of_accounts_and_import_keys

---
 .../wallet_tests/test_api_helper_methods.py   | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/tests/functional_tests/wallet_tests/test_api_helper_methods.py b/tests/functional_tests/wallet_tests/test_api_helper_methods.py
index c41814216..b6b49d627 100644
--- a/tests/functional_tests/wallet_tests/test_api_helper_methods.py
+++ b/tests/functional_tests/wallet_tests/test_api_helper_methods.py
@@ -60,3 +60,35 @@ def test_creation_of_huge_number_of_accounts(node: tt.InitNode, wallet: tt.Walle
 
     assert len(created_accounts) == amount_of_accounts_to_create
     assert len(accounts_after.difference(accounts_before)) == amount_of_accounts_to_create
+
+
+@pytest.mark.node_shared_file_size("16G")
+def test_creation_of_huge_number_of_accounts_and_import_keys(node: tt.InitNode, wallet: tt.Wallet) -> None:
+    """
+    Time: 03m 52s.
+
+    Hardware:
+        MEMORY: 16GiB DIMM DDR4 Synchronous Unbuffered (Unregistered) 2133 MHz (0,5 ns)
+        STORAGE: Samsung SSD 980 1TB NVMe disk
+        PROCESSOR: AMD Ryzen 7 5700G with Radeon Graphics 8 core, 16 threads.
+    """
+    amount_of_accounts_to_create = 200_000
+
+    # This is required to make possible pushing 21 trxs per block after 21'th block
+    wallet.api.update_witness(
+        witness_name="initminer",
+        url="https://initminer.com",
+        block_signing_key=tt.Account("initminer").public_key,
+        props={
+            "account_creation_fee": tt.Asset.TestT(amount=1),
+            "maximum_block_size": 2097152,
+            "hbd_interest_rate": 0,
+        },
+    )
+
+    tt.logger.info("Wait 42 blocks for change of account_creation_fee")
+    node.wait_for_block_with_number(42)
+
+    wallet.create_accounts(amount_of_accounts_to_create, import_keys=True)
+
+    assert len(wallet.api.list_keys()) - 1 == amount_of_accounts_to_create, "Keys was not imported correctly"
-- 
GitLab