From 201b0343697525291c8f543b02fb3217caee9237 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Fri, 3 May 2024 15:14:55 -0400 Subject: [PATCH] fix: fmt --- cmd/crates/stellar-ledger/src/lib.rs | 15 +++------------ cmd/soroban-cli/src/signer.rs | 14 +++++++------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/cmd/crates/stellar-ledger/src/lib.rs b/cmd/crates/stellar-ledger/src/lib.rs index 76fbdec24..0bd0ee07d 100644 --- a/cmd/crates/stellar-ledger/src/lib.rs +++ b/cmd/crates/stellar-ledger/src/lib.rs @@ -86,17 +86,6 @@ pub struct LedgerOptions { exchange: T, hd_path: slip10::BIP32Path, } -// let hidapi = HidApi::new().map_err(NEARLedgerError::HidApiError)?; -// TransportNativeHID::new(&hidapi).map_err(NEARLedgerError::LedgerHidError) -impl LedgerOptions { - pub fn new(hd_path: u32) -> Result { - let hd_path = bip_path_from_index(hd_path)?; - Ok(LedgerOptions { - exchange: transport_native_hid()?, - hd_path, - }) - } -} pub struct LedgerSigner { network_passphrase: String, @@ -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, diff --git a/cmd/soroban-cli/src/signer.rs b/cmd/soroban-cli/src/signer.rs index 89b484bed..7e293eec0 100644 --- a/cmd/soroban-cli/src/signer.rs +++ b/cmd/soroban-cli/src/signer.rs @@ -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 { @@ -38,6 +37,7 @@ fn requires_auth(txn: &Transaction) -> Option { } /// 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;