Skip to content

Commit e5295f6

Browse files
fix
Signed-off-by: tech0priyanshu <[email protected]>
1 parent f63a176 commit e5295f6

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
1010
- Refactored `account_create_transaction_without_alias.py` into smaller, modular functions.
1111
- Added comprehensive training documentation for the `Query` class, covering execution flow, payments, retries, and building child queries. (#1238)
1212
- Beginner issue documentation and updated GFI and GFIC templates and documentation
13-
- Refactored `account_create_transaction_without_alias.py` into smaller, modular functions.
1413
- Enable auto assignment to good first issues (#1312), archived good first issue support team notification. Changed templates with new assign instruction.
1514

1615
### Changed

examples/account/account_create_transaction_without_alias.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from hiero_sdk_python import (
2323
Client,
2424
PrivateKey,
25+
PublicKey,
2526
AccountCreateTransaction,
2627
AccountInfoQuery,
2728
Network,
@@ -32,26 +33,24 @@
3233
)
3334

3435
load_dotenv()
35-
network_name = os.getenv("NETWORK", "testnet").lower()
3636

3737

3838
def setup_client() -> Client:
3939
"""Setup Client."""
40-
network_name = os.getenv("NETWORK", "testnet").lower()
41-
print(f"Connecting to Hedera {network_name} network!")
4240
client = Client.from_env()
41+
print(f"Network: {client.network.network}")
4342
print(f"Client set up with operator id {client.operator_account_id}")
4443
return client
4544

46-
def generate_account_key() -> Tuple[PrivateKey, 'PublicKey']:
45+
def generate_account_key() -> Tuple[PrivateKey, PublicKey]:
4746
"""Generate a key pair for the account."""
4847
print("\nSTEP 1: Generating a key pair for the account (no alias)...")
4948
account_private_key = PrivateKey.generate()
5049
account_public_key = account_private_key.public_key()
5150
print(f"✅ Account public key (no alias): {account_public_key}")
5251
return account_private_key, account_public_key
5352

54-
def create_account_without_alias(client: Client, account_public_key: 'PublicKey', account_private_key: PrivateKey) -> AccountId:
53+
def create_account_without_alias(client: Client, account_public_key: PublicKey, account_private_key: PrivateKey) -> AccountId:
5554
"""Create an account without setting any alias."""
5655
print("\nSTEP 2: Creating the account without setting any alias...")
5756

@@ -61,10 +60,7 @@ def create_account_without_alias(client: Client, account_public_key: 'PublicKey'
6160
memo="Account created without alias",
6261
)
6362
.set_key_without_alias(account_public_key)
64-
)
65-
66-
transaction = (
67-
transaction.freeze_with(client)
63+
.freeze_with(client)
6864
.sign(account_private_key)
6965
)
7066

0 commit comments

Comments
 (0)