Skip to content

Commit c72a5ce

Browse files
docs: update examples and templates to avoid deprecated set_key usage
Signed-off-by: prishajaiswal75 <[email protected]>
1 parent e3620cd commit c72a5ce

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/ISSUE_TEMPLATE/01_good_first_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ body:
9898
test_key = PrivateKey.generate_ed25519()
9999
receipt = (
100100
AccountCreateTransaction()
101-
.set_key(test_key.public_key())
101+
.set_key_without_alias(test_key.public_key())
102102
.set_initial_balance(Hbar(1))
103103
.set_account_memo("Test account for token association demo")
104104
.freeze_with(client)

.github/ISSUE_TEMPLATE/04_good_first_issue_candidate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ body:
106106
test_key = PrivateKey.generate_ed25519()
107107
receipt = (
108108
AccountCreateTransaction()
109-
.set_key(test_key.public_key())
109+
.set_key_without_alias(test_key.public_key())
110110
.set_initial_balance(Hbar(1))
111111
.set_account_memo("Test account for token association demo")
112112
.freeze_with(client)

examples/account/account_create_transaction_evm_alias.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,17 @@ def create_account_with_alias(client):
4848
print("\nSTEP 1: Generating a new ECDSA key pair for the account alias...")
4949
private_key = PrivateKey.generate('ecdsa')
5050
public_key = private_key.public_key()
51-
print("✅ Generated new ECDSA key pair. The EVM address alias will be automatically derived.")
51+
evm_alias = public_key.to_evm_address()
52+
if evm_alias is None:
53+
raise RuntimeError("Failed to derive EVM address alias from public key")
54+
55+
56+
print(
57+
"✅ Generated new ECDSA key pair.\n"
58+
f"ℹ️ Derived EVM address alias (for reference): {evm_alias}\n"
59+
" Note: The alias is automatically applied by the network during account creation."
60+
)
61+
5262
# Create the account with the alias
5363
print("\nSTEP 2: Creating the account with the EVM address alias...")
5464
transaction = (

0 commit comments

Comments
 (0)