diff --git a/sdk/src/client/api/types.rs b/sdk/src/client/api/types.rs index 81801ff6f8..ba9c9351e3 100644 --- a/sdk/src/client/api/types.rs +++ b/sdk/src/client/api/types.rs @@ -23,8 +23,7 @@ use crate::{ }; /// Helper struct for offline signing -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct PreparedTransactionData { /// Transaction essence pub essence: TransactionEssence, @@ -165,7 +164,7 @@ impl SignedTransactionData { } /// Data for a remainder output, used for ledger nano -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct RemainderData { /// The remainder output pub output: Output, diff --git a/sdk/src/client/secret/ledger_nano.rs b/sdk/src/client/secret/ledger_nano.rs index 27d8e7c5a5..a6d44d5ea5 100644 --- a/sdk/src/client/secret/ledger_nano.rs +++ b/sdk/src/client/secret/ledger_nano.rs @@ -254,12 +254,9 @@ impl SecretManage for LedgerSecretManager { }); } - if coin_type.is_none() || account_index.is_none() { - return Err(Error::NoAvailableInputsProvided)?; - } + let (coin_type, account_index) = coin_type.zip(account_index).ok_or(Error::NoAvailableInputsProvided)?; - let coin_type = coin_type.unwrap(); - let bip32_account = account_index.unwrap().harden().into(); + let bip32_account = account_index.harden().into(); // pack essence and hash into vec let essence_bytes = prepared_transaction.essence.pack_to_vec(); diff --git a/sdk/src/wallet/account/operations/transaction/high_level/minting/create_native_token.rs b/sdk/src/wallet/account/operations/transaction/high_level/minting/create_native_token.rs index 36f9cae1f9..8f4654c37a 100644 --- a/sdk/src/wallet/account/operations/transaction/high_level/minting/create_native_token.rs +++ b/sdk/src/wallet/account/operations/transaction/high_level/minting/create_native_token.rs @@ -63,8 +63,7 @@ impl From<&CreateNativeTokenTransaction> for CreateNativeTokenTransactionDto { } /// The result of preparing a transaction to create a native token -#[derive(Debug, Serialize)] -#[serde(rename_all = "camelCase")] +#[derive(Debug)] pub struct PreparedCreateNativeTokenTransaction { pub token_id: TokenId, pub transaction: PreparedTransactionData,