Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Jul 14, 2023
1 parent f08cee2 commit a575cb6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 2 additions & 3 deletions sdk/src/client/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions sdk/src/client/secret/ledger_nano.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a575cb6

Please sign in to comment.