@@ -10,6 +10,7 @@ use colored::Colorize;
1010use eyre:: Error ;
1111use iota_sdk:: {
1212 client:: { api:: options:: TransactionOptions , request_funds_from_faucet, secret:: SecretManager } ,
13+ crypto:: signatures:: ed25519:: PublicKey ,
1314 types:: block:: {
1415 address:: { AccountAddress , Bech32Address , ToBech32Ext } ,
1516 mana:: ManaAllotment ,
@@ -25,9 +26,9 @@ use iota_sdk::{
2526 } ,
2627 utils:: ConvertTo ,
2728 wallet:: {
28- types:: OutputData , BeginStakingParams , ConsolidationParams , CreateDelegationParams , CreateNativeTokenParams ,
29- MintNftParams , ModifyAccountBlockIssuerKey , OutputsToClaim , ReturnStrategy , SendManaParams ,
30- SendNativeTokenParams , SendNftParams , SendParams , SyncOptions , Wallet , WalletError ,
29+ types:: OutputData , AccountSyncOptions , BeginStakingParams , ConsolidationParams , CreateDelegationParams ,
30+ CreateNativeTokenParams , MintNftParams , ModifyAccountBlockIssuerKey , OutputsToClaim , ReturnStrategy ,
31+ SendManaParams , SendNativeTokenParams , SendNftParams , SendParams , SyncOptions , Wallet , WalletError ,
3132 } ,
3233 U256 ,
3334} ;
@@ -751,7 +752,17 @@ pub async fn create_native_token_command(
751752 . wait_for_transaction_acceptance ( & transaction. transaction_id , None , None )
752753 . await ?;
753754 // Sync wallet after the transaction got confirmed, so the account output is available
754- wallet. sync ( None ) . await ?;
755+ wallet
756+ . sync ( Some ( SyncOptions {
757+ sync_native_token_foundries : true ,
758+ sync_implicit_accounts : true ,
759+ account : AccountSyncOptions {
760+ basic_outputs : true ,
761+ ..Default :: default ( )
762+ } ,
763+ ..Default :: default ( )
764+ } ) )
765+ . await ?;
755766 }
756767
757768 let params = CreateNativeTokenParams {
@@ -942,10 +953,10 @@ pub async fn implicit_accounts_command(wallet: &Wallet) -> Result<(), Error> {
942953
943954// `add-block-issuer-key` command
944955pub async fn add_block_issuer_key ( wallet : & Wallet , account_id : AccountId , issuer_key : & str ) -> Result < ( ) , Error > {
945- let issuer_key : [ u8 ; Ed25519PublicKeyHashBlockIssuerKey :: LENGTH ] = prefix_hex:: decode ( issuer_key) ?;
956+ let public_key = PublicKey :: try_from_bytes ( prefix_hex:: decode ( issuer_key) ? ) ?;
946957 let params = ModifyAccountBlockIssuerKey {
947958 account_id,
948- keys_to_add : vec ! [ Ed25519PublicKeyHashBlockIssuerKey :: new ( issuer_key ) . into( ) ] ,
959+ keys_to_add : vec ! [ Ed25519PublicKeyHashBlockIssuerKey :: from_public_key ( public_key ) . into( ) ] ,
949960 keys_to_remove : vec ! [ ] ,
950961 } ;
951962
@@ -962,11 +973,11 @@ pub async fn add_block_issuer_key(wallet: &Wallet, account_id: AccountId, issuer
962973
963974// `remove-block-issuer-key` command
964975pub async fn remove_block_issuer_key ( wallet : & Wallet , account_id : AccountId , issuer_key : & str ) -> Result < ( ) , Error > {
965- let issuer_key : [ u8 ; Ed25519PublicKeyHashBlockIssuerKey :: LENGTH ] = prefix_hex:: decode ( issuer_key) ?;
976+ let public_key = PublicKey :: try_from_bytes ( prefix_hex:: decode ( issuer_key) ? ) ?;
966977 let params = ModifyAccountBlockIssuerKey {
967978 account_id,
968979 keys_to_add : vec ! [ ] ,
969- keys_to_remove : vec ! [ Ed25519PublicKeyHashBlockIssuerKey :: new ( issuer_key ) . into( ) ] ,
980+ keys_to_remove : vec ! [ Ed25519PublicKeyHashBlockIssuerKey :: from_public_key ( public_key ) . into( ) ] ,
970981 } ;
971982
972983 let transaction = wallet. modify_account_output_block_issuer_keys ( params, None ) . await ?;
@@ -1199,6 +1210,10 @@ pub async fn sync_command(wallet: &Wallet) -> Result<(), Error> {
11991210 . sync ( Some ( SyncOptions {
12001211 sync_native_token_foundries : true ,
12011212 sync_implicit_accounts : true ,
1213+ account : AccountSyncOptions {
1214+ basic_outputs : true ,
1215+ ..Default :: default ( )
1216+ } ,
12021217 ..Default :: default ( )
12031218 } ) )
12041219 . await ?;
0 commit comments