Skip to content

Commit a00bace

Browse files
committed
chore: bump tx-fee for the tests
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent a2be51f commit a00bace

7 files changed

Lines changed: 52 additions & 22 deletions

examples/nodes/node_create_transaction.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from dotenv import load_dotenv
2424

2525
from hiero_sdk_python import AccountId, Client, Network, PrivateKey
26+
from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
2627
from hiero_sdk_python.address_book.endpoint import Endpoint
2728
from hiero_sdk_python.nodes.node_create_transaction import NodeCreateTransaction
2829
from hiero_sdk_python.response_code import ResponseCode
@@ -65,7 +66,13 @@ def node_create():
6566

6667
# Node account ID - this should be an existing account
6768
# that will be associated with the node
68-
account_id = AccountId.from_string("0.0.4")
69+
account_id = (
70+
AccountCreateTransaction()
71+
.set_key_without_alias(PrivateKey.generate_ecdsa())
72+
.freeze_with(client)
73+
.execute(client)
74+
.account_id
75+
)
6976

7077
# Node description
7178
description = "Example node"

examples/nodes/node_delete_transaction.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from dotenv import load_dotenv
2424

2525
from hiero_sdk_python import AccountId, Client, Network, PrivateKey
26+
from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
2627
from hiero_sdk_python.address_book.endpoint import Endpoint
2728
from hiero_sdk_python.nodes.node_create_transaction import NodeCreateTransaction
2829
from hiero_sdk_python.nodes.node_delete_transaction import NodeDeleteTransaction
@@ -64,7 +65,13 @@ def create_node(client):
6465
"""Create a node on the network and return its ID and admin key."""
6566
# Node account ID - this should be an existing account
6667
# that will be associated with the node
67-
account_id = AccountId.from_string("0.0.4")
68+
account_id = account_id = (
69+
AccountCreateTransaction()
70+
.set_key_without_alias(PrivateKey.generate_ecdsa())
71+
.freeze_with(client)
72+
.execute(client)
73+
.account_id
74+
)
6875

6976
# Node description
7077
description = "Example node for deletion"

examples/nodes/node_update_transaction.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from dotenv import load_dotenv
2424

2525
from hiero_sdk_python import AccountId, Client, Network, PrivateKey
26+
from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
2627
from hiero_sdk_python.address_book.endpoint import Endpoint
2728
from hiero_sdk_python.nodes.node_create_transaction import NodeCreateTransaction
2829
from hiero_sdk_python.nodes.node_update_transaction import NodeUpdateTransaction
@@ -60,12 +61,8 @@ def setup_client():
6061
return client
6162

6263

63-
def create_node(client):
64+
def create_node(client, account_id):
6465
"""Create a node on the network and return its ID and admin key."""
65-
# Node account ID - this should be an existing account
66-
# that will be associated with the node
67-
account_id = AccountId.from_string("0.0.4")
68-
6966
# Node description
7067
description = "Example node"
7168

@@ -108,11 +105,8 @@ def create_node(client):
108105
return receipt.node_id, admin_key
109106

110107

111-
def update_node(client, node_id, admin_key):
108+
def update_node(client, account_id, node_account_key, node_id, admin_key):
112109
"""Update an existing node with new parameters."""
113-
# Node account ID
114-
account_id = AccountId.from_string("0.0.4")
115-
116110
# Updated node description
117111
updated_description = "Updated example node"
118112

@@ -139,7 +133,8 @@ def update_node(client, node_id, admin_key):
139133
.set_grpc_web_proxy_endpoint(updated_grpc_proxy_endpoint)
140134
.set_decline_reward(False)
141135
.freeze_with(client)
142-
.sign(admin_key) # Sign with the admin key
136+
.sign(admin_key)
137+
.sign(node_account_key)
143138
.execute(client)
144139
)
145140

@@ -163,11 +158,20 @@ def node_update():
163158
# Set up client with operator account
164159
client = setup_client()
165160

161+
node_account_private_key = PrivateKey.generate_ecdsa()
162+
node_account_id = (
163+
AccountCreateTransaction()
164+
.set_key_without_alias(node_account_private_key)
165+
.freeze_with(client)
166+
.execute(client)
167+
.account_id
168+
)
169+
166170
# Create a new node and get its ID and admin key
167-
node_id, admin_key = create_node(client)
171+
node_id, admin_key = create_node(client, node_account_id)
168172

169173
# Update the newly created node with modified parameters
170-
update_node(client, node_id, admin_key)
174+
update_node(client, node_account_id, node_account_private_key, node_id, admin_key)
171175

172176
print("\nNode creation and update example completed successfully!")
173177

tests/integration/account_update_transaction_e2e_test.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@ def test_integration_account_update_transaction_set_key_with_threshold_keylist(e
9292
key_2_private = PrivateKey.generate_ed25519()
9393
threshold_key = KeyList([key_1_private.public_key(), key_2_private.public_key()], threshold=2)
9494

95-
receipt = (
95+
tx = (
9696
AccountUpdateTransaction()
9797
.set_account_id(account_id)
9898
.set_key(threshold_key)
99-
.freeze_with(env.client)
100-
.sign(key_1_private)
101-
.sign(key_2_private)
102-
.execute(env.client)
10399
)
100+
101+
tx.transaction_fee = Hbar.from_hbars(5)
102+
tx.freeze_with(env.client)
103+
tx.sign(key_1_private)
104+
tx.sign(key_2_private)
105+
106+
receipt = tx.execute(env.client)
107+
104108
assert receipt.status == ResponseCode.SUCCESS, (
105109
f"Account key rotation to KeyList failed with status: {ResponseCode(receipt.status).name}"
106110
)

tests/integration/batch_transaction_e2e_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from hiero_sdk_python.crypto.private_key import PrivateKey
99
from hiero_sdk_python.crypto.public_key import PublicKey
1010
from hiero_sdk_python.file.file_id import FileId
11+
from hiero_sdk_python.hbar import Hbar
1112
from hiero_sdk_python.query.account_info_query import AccountInfoQuery
1213
from hiero_sdk_python.query.transaction_get_receipt_query import TransactionGetReceiptQuery
1314
from hiero_sdk_python.response_code import ResponseCode
@@ -95,10 +96,12 @@ def test_batch_transaction_can_execute_large_batch(env):
9596
)
9697

9798
batch_tx.add_inner_transaction(transfer_tx)
98-
99+
100+
batch_tx.transaction_fee = Hbar.from_hbars(10)
99101
batch_tx.freeze_with(env.client)
100102
batch_tx.sign(batch_key)
101103

104+
102105
batch_receipt = batch_tx.execute(env.client)
103106

104107
assert batch_receipt.status == ResponseCode.SUCCESS

tests/integration/ethereum_transaction_e2e_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ def test_integration_ethereum_transaction_jumbo_transaction(env):
147147
alias_private_key,
148148
)
149149

150-
receipt = EthereumTransaction().set_ethereum_data(transaction_data).execute(env.client)
150+
tx = EthereumTransaction().set_ethereum_data(transaction_data)
151+
tx.transaction_fee = Hbar.from_hbars(10)
152+
receipt = tx.execute(env.client)
151153
assert receipt.status == ResponseCode.SUCCESS, (
152154
f"Ethereum transaction failed with status: {ResponseCode(receipt.status).name}"
153155
)

tests/integration/topic_message_submit_transaction_e2e_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,18 @@ def test_integration_scheduled_topic_message_submit_transaction_can_execute_with
250250
.set_topic_id(topic_id)
251251
.set_message("Hello, Python SDK!")
252252
.add_custom_fee_limit(topic_message_submit_fee_limit)
253-
.schedule()
254253
)
255254
tx.transaction_fee = Hbar(2).to_tinybars()
255+
tx = tx.schedule()
256+
256257
receipt = tx.execute(env.client)
257258

258259
assert receipt.status == ResponseCode.SUCCESS, (
259260
f"Message submission failed with status: {ResponseCode(receipt.status).name}"
260261
)
261262

263+
264+
262265
info = TopicInfoQuery(topic_id=topic_id).execute(env.client)
263266
assert info.sequence_number == 1
264267

0 commit comments

Comments
 (0)