Skip to content

Commit 9a683f0

Browse files
committed
chore: increase tx-fee for example
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
1 parent 95d7540 commit 9a683f0

4 files changed

Lines changed: 33 additions & 13 deletions

File tree

examples/account/account_update_transaction_with_keylist.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,15 @@ def account_update_with_keylist():
8484
threshold_key = KeyList([threshold_key_1.public_key(), threshold_key_2.public_key()], threshold=2)
8585

8686
print("\nRotating account key to a 2-of-2 threshold KeyList...")
87-
key_list_receipt = (
88-
AccountUpdateTransaction()
89-
.set_account_id(account_id)
90-
.set_key(threshold_key)
91-
.freeze_with(client)
92-
.sign(current_private_key) # Sign with current key
93-
.sign(threshold_key_1) # First signature for threshold=2
94-
.sign(threshold_key_2) # Second signature for threshold=2
95-
.execute(client)
96-
)
87+
tx = AccountUpdateTransaction().set_account_id(account_id).set_key(threshold_key)
88+
89+
tx.transaction_fee = Hbar.from_hbars(10)
90+
91+
tx.freeze_with(client)
92+
tx.sign(current_private_key) # Sign with current key
93+
tx.sign(threshold_key_1) # First signature for threshold=2
94+
tx.sign(threshold_key_2) # Second signature for threshold=2
95+
key_list_receipt = tx.execute(client)
9796

9897
if key_list_receipt.status != ResponseCode.SUCCESS:
9998
print(f"KeyList rotation failed with status: {ResponseCode(key_list_receipt.status).name}")

tests/integration/node_create_transaction_e2e_test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import pytest
88

9+
from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
910
from hiero_sdk_python.account.account_id import AccountId
1011
from hiero_sdk_python.address_book.endpoint import Endpoint
1112
from hiero_sdk_python.client.client import Client
@@ -42,7 +43,13 @@ def test_node_create_transaction_can_execute():
4243
client.set_operator(AccountId(0, 0, 2), original_operator_key)
4344

4445
# The account of the new node
45-
account_id = AccountId(0, 0, 4)
46+
account_id = (
47+
AccountCreateTransaction()
48+
.set_key_without_alias(PrivateKey.generate_ecdsa())
49+
.freeze_with(client)
50+
.execute(client)
51+
.account_id
52+
)
4653

4754
# Description of the new node
4855
description = "test"

tests/integration/node_delete_transaction_e2e_test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import pytest
88

9+
from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
910
from hiero_sdk_python.account.account_id import AccountId
1011
from hiero_sdk_python.address_book.endpoint import Endpoint
1112
from hiero_sdk_python.client.client import Client
@@ -39,7 +40,14 @@ def test_node_delete_transaction_can_execute():
3940
)
4041
client.set_operator(AccountId(0, 0, 2), original_operator_key)
4142

42-
account_id = AccountId(0, 0, 4) # This is the account of the node
43+
# This is the account of the node
44+
account_id = (
45+
AccountCreateTransaction()
46+
.set_key_without_alias(PrivateKey.generate_ecdsa())
47+
.freeze_with(client)
48+
.execute(client)
49+
.account_id
50+
)
4351

4452
# Endpoints for the node
4553
endpoint = Endpoint(domain_name="test.com", port=123)

tests/integration/node_update_transaction_e2e_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import pytest
88

9+
from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
910
from hiero_sdk_python.account.account_id import AccountId
1011
from hiero_sdk_python.address_book.endpoint import Endpoint
1112
from hiero_sdk_python.client.client import Client
@@ -39,7 +40,11 @@ def test_node_update_transaction_can_execute():
3940
)
4041
client.set_operator(AccountId(0, 0, 2), original_operator_key)
4142

42-
account_id = AccountId(0, 0, 4) # This is the account of the node
43+
# This is the account of the node
44+
account_key = PrivateKey.generate_ecdsa()
45+
account_id = (
46+
AccountCreateTransaction().set_key_without_alias(account_key).freeze_with(client).execute(client).account_id
47+
)
4348

4449
# Endpoints for the node
4550
endpoint = Endpoint(domain_name="test.com", port=123)
@@ -79,6 +84,7 @@ def test_node_update_transaction_can_execute():
7984
.set_grpc_web_proxy_endpoint(update_proxy_endpoint)
8085
.freeze_with(client)
8186
.sign(admin_key)
87+
.sign(account_key)
8288
.execute(client)
8389
)
8490

0 commit comments

Comments
 (0)