Skip to content

Commit 7607eca

Browse files
test: increase initial balances of accounts (#124)
Signed-off-by: skurzyp-blockydevs <stanislaw.kurzyp@blockydevs.com>
1 parent 4b750e9 commit 7607eca

File tree

10 files changed

+17
-44
lines changed

10 files changed

+17
-44
lines changed

python/hedera_agent_kit/plugins/core_account_plugin/create_account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def create_account_prompt(context: Context = {}) -> str:
5757
5858
This tool will create a new Hedera account with a passed public key. If not passed, the tool will use operator's public key.
5959
60+
IMPORTANT: All parameters are optional. If the user does not explicitly provide optional parameters, proceed immediately using the default values. Do NOT ask the user for optional parameters.
61+
6062
Parameters:
6163
- public_key (str, optional): Public key to use for the account. If not provided, the tool will use the operator's public key.
6264
- account_memo (str, optional): Optional memo for the account. Can be up to 100 characters long. Too long memos will be truncated in params normalization

python/hedera_agent_kit/plugins/core_consensus_plugin/create_topic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_topic_prompt(context: Context = {}) -> str:
5252
- topic_memo (str, optional): A memo for the topic.
5353
- transaction_memo (str, optional): An optional memo to include on the submitted transaction.
5454
- submit_key (bool or str, optional): Submit key for the topic. Pass boolean `true` to use the operator/user key,
55-
or provide a Hedera-compatible public key string. Defaults to None (no submit key). If set, restricts who can submit messages to the topic.
55+
or provide a Hedera-compatible public key string. Defaults to false (no submit key). If set, restricts who can submit messages to the topic.
5656
- admin_key (bool or str, optional): Admin key for the topic. Pass boolean `true` to use the operator/user key,
5757
or provide a Hedera-compatible public key string. Defaults to true (operator key).
5858

python/hedera_agent_kit/shared/parameter_schemas/consensus_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CreateTopicParameters(BaseModelWithArbitraryTypes):
3232
"or provide a Hedera-compatible public key string (optional). If set, restricts who can submit messages to the topic."
3333
),
3434
),
35-
] = None
35+
] = False
3636

3737
admin_key: Annotated[
3838
Optional[Union[bool, str]],

python/test/e2e/create_non_fungible_token_e2e_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ async def test_create_nft_minimal_params(
187187
assert token_info.name == "MyNFT"
188188
assert token_info.symbol == "MNFT"
189189
assert token_info.token_type == TokenType.NON_FUNGIBLE_UNIQUE
190-
# Default max supply is infinite (0)
191-
assert token_info.max_supply == 0
190+
# Default supply type is finite
191+
assert token_info.supply_type == SupplyType.FINITE
192+
assert token_info.max_supply == 100 # the default max supply is 100
192193

193194

194195
@pytest.mark.asyncio

python/test/e2e/delete_token_allowance_e2e_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from test.utils.teardown import return_hbars_and_delete_account
4040

4141
# Constants
42-
DEFAULT_EXECUTOR_BALANCE = Hbar(50, in_tinybars=False)
42+
DEFAULT_EXECUTOR_BALANCE = Hbar(100, in_tinybars=False)
4343
MIRROR_NODE_WAITING_TIME_SEC = 10
4444

4545

@@ -153,7 +153,7 @@ async def spender_account(
153153
# Executor creates spender funded with a small balance
154154
spender_resp = await executor_wrapper.create_account(
155155
CreateAccountParametersNormalised(
156-
initial_balance=Hbar(50),
156+
initial_balance=Hbar(100),
157157
key=spender_key.public_key(),
158158
)
159159
)

python/test/e2e/get_hbar_balance_e2e_test.py

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def executor_account(
6565

6666
await wait(MIRROR_NODE_WAITING_TIME)
6767

68-
yield executor_account_id, executor_key, executor_client, executor_wrapper
68+
yield executor_account_id, executor_key, executor_client, executor_wrapper, operator_wrapper
6969

7070
await return_hbars_and_delete_account(
7171
executor_wrapper,
@@ -77,7 +77,7 @@ async def executor_account(
7777
@pytest.fixture
7878
async def langchain_test_setup(executor_account):
7979
"""Initialize LangChain agent and toolkit using executor client as operator."""
80-
_, _, executor_client, _ = executor_account
80+
_, _, executor_client, _, _ = executor_account
8181
setup = await create_langchain_test_setup(custom_client=executor_client)
8282
yield setup
8383
setup.cleanup()
@@ -139,36 +139,6 @@ async def execute_get_hbar_balance(
139139
# TEST CASES
140140
# ============================================================================
141141

142-
143-
@pytest.mark.asyncio
144-
async def test_get_hbar_balance_for_executor_account(
145-
agent_executor,
146-
executor_account,
147-
langchain_config,
148-
response_parser: ResponseParserService,
149-
):
150-
"""Test fetching HBAR balance for executor (default) account."""
151-
executor_account_id, _, executor_client, executor_wrapper = executor_account
152-
executor_id_str = str(executor_account_id)
153-
154-
# Get expected balance directly (before agent call)
155-
expected_balance = executor_wrapper.get_account_hbar_balance(executor_id_str)
156-
157-
input_text = f"What is the HBAR balance of {executor_id_str}?"
158-
parsed_data = await execute_get_hbar_balance(
159-
agent_executor, input_text, langchain_config, response_parser
160-
)
161-
162-
human_message = parsed_data["humanMessage"]
163-
raw_data = parsed_data["raw"]
164-
165-
assert parsed_data.get("error") is None
166-
assert executor_id_str in human_message
167-
168-
assert str(int(expected_balance)) in raw_data.get("balance")
169-
assert "HBAR Balance" in human_message
170-
171-
172142
@pytest.mark.asyncio
173143
async def test_get_hbar_balance_for_specific_account_nonzero(
174144
agent_executor,

python/test/e2e/get_pending_airdrop_query_e2e_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def setup_environment():
8181
recipient_resp = await operator_wrapper.create_account(
8282
CreateAccountParametersNormalised(
8383
key=executor_key.public_key(), # Using an executor key for simplicity in test control
84-
initial_balance=Hbar(0),
84+
initial_balance=Hbar(20),
8585
max_automatic_token_associations=0,
8686
)
8787
)

python/test/e2e/mint_erc721_e2e_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def setup_environment():
5454
# Recipient account
5555
recipient_resp = await operator_wrapper.create_account(
5656
CreateAccountParametersNormalised(
57-
key=executor_key.public_key(), initial_balance=Hbar(5)
57+
key=executor_key.public_key(), initial_balance=Hbar(20)
5858
)
5959
)
6060
recipient_account_id = recipient_resp.account_id

python/test/e2e/transfer_non_fungible_token_with_allowance_e2e_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
from test.utils.teardown import return_hbars_and_delete_account
3939

4040
# Constants
41-
DEFAULT_OWNER_BALANCE = Hbar(100)
42-
DEFAULT_SPENDER_BALANCE = Hbar(50)
41+
DEFAULT_OWNER_BALANCE = Hbar(150)
42+
DEFAULT_SPENDER_BALANCE = Hbar(100)
4343
TOOL_NAME = "transfer_non_fungible_token_with_allowance_tool"
4444

4545

python/test/e2e/update_topic_e2e_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from test.utils.teardown import return_hbars_and_delete_account
3232

3333
# Constants
34-
DEFAULT_EXECUTOR_BALANCE = Hbar(20, in_tinybars=False)
34+
DEFAULT_EXECUTOR_BALANCE = Hbar(50, in_tinybars=False)
3535

3636

3737
# ============================================================================
@@ -309,7 +309,7 @@ async def test_update_autorenew_account(
309309
secondary_key = executor_client.operator_private_key
310310
secondary_resp = await executor_wrapper.create_account(
311311
CreateAccountParametersNormalised(
312-
initial_balance=Hbar(0), key=secondary_key.public_key()
312+
initial_balance=Hbar(50), key=secondary_key.public_key()
313313
)
314314
)
315315
secondary_account_id = str(secondary_resp.account_id)

0 commit comments

Comments
 (0)