Skip to content

Commit

Permalink
fix: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed May 3, 2024
1 parent 8d63c33 commit 09afd3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
15 changes: 3 additions & 12 deletions cmd/crates/stellar-ledger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ pub struct LedgerOptions<T: Exchange> {
exchange: T,
hd_path: slip10::BIP32Path,
}
// let hidapi = HidApi::new().map_err(NEARLedgerError::HidApiError)?;
// TransportNativeHID::new(&hidapi).map_err(NEARLedgerError::LedgerHidError)
impl LedgerOptions<TransportNativeHID> {
pub fn new(hd_path: u32) -> Result<Self, LedgerError> {
let hd_path = bip_path_from_index(hd_path)?;
Ok(LedgerOptions {
exchange: transport_native_hid()?,
hd_path,
})
}
}

pub struct LedgerSigner<T: Exchange> {
network_passphrase: String,
Expand Down Expand Up @@ -137,7 +126,9 @@ where
let hd_path = bip_path_from_index(index)?;
Self::get_public_key_with_display_flag(self, hd_path, false).await
}

/// Synchronous version of get_public_key
/// # Errors
///
pub fn get_public_key_sync(
&self,
index: u32,
Expand Down
14 changes: 7 additions & 7 deletions cmd/soroban-cli/src/signer.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use ed25519_dalek::Signer;
use sha2::{digest::typenum::Le, Digest, Sha256};
use sha2::{Digest, Sha256};

use soroban_env_host::xdr::{
self, AccountId, DecoratedSignature, Hash, HashIdPreimage, HashIdPreimageSorobanAuthorization,
InvokeHostFunctionOp, Limits, Operation, OperationBody, PublicKey, ReadXdr, ScAddress, ScMap,
ScSymbol, ScVal, Signature, SignatureHint, SorobanAddressCredentials,
SorobanAuthorizationEntry, SorobanAuthorizedFunction, SorobanCredentials, Transaction,
TransactionEnvelope, TransactionSignaturePayload, TransactionSignaturePayloadTaggedTransaction,
InvokeHostFunctionOp, Limits, Operation, OperationBody, PublicKey, ScAddress, ScMap, ScSymbol,
ScVal, Signature, SignatureHint, SorobanAddressCredentials, SorobanAuthorizationEntry,
SorobanAuthorizedFunction, SorobanCredentials, Transaction, TransactionEnvelope,
TransactionSignaturePayload, TransactionSignaturePayloadTaggedTransaction,
TransactionV1Envelope, Uint256, WriteXdr,
};
use soroban_sdk::xdr::BytesM;
use stellar_ledger::{LedgerSigner, NativeSigner};
use stellar_ledger::NativeSigner;

#[derive(thiserror::Error, Debug)]
pub enum Error {
Expand Down Expand Up @@ -38,6 +37,7 @@ fn requires_auth(txn: &Transaction) -> Option<xdr::Operation> {
}

/// A trait for signing Stellar transactions and Soroban authorization entries
#[allow(async_fn_in_trait)]
pub trait Stellar {
/// The type of the options that can be passed when creating a new signer
type Init;
Expand Down

0 comments on commit 09afd3c

Please sign in to comment.