File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 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)
Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff line change @@ -48,7 +48,17 @@ def create_account_with_alias(client):
4848 print ("\n STEP 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 ("\n STEP 2: Creating the account with the EVM address alias..." )
5464 transaction = (
You can’t perform that action at this time.
0 commit comments