Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
FroVolod committed Jan 22, 2024
1 parent b1c431c commit 5d95e82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions examples/common/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::str::FromStr;

use ed25519_dalek::Signature;
use ed25519_dalek::Verifier;
use near_primitives_core::{borsh::BorshSerialize, hash::CryptoHash, types::AccountId};
use near_primitives_core::{borsh, borsh::BorshSerialize, hash::CryptoHash, types::AccountId};

pub fn display_pub_key(public_key: ed25519_dalek::PublicKey) {
log::info!("---");
Expand Down Expand Up @@ -47,9 +47,8 @@ pub fn serialize_and_display_tx(transaction: near_primitives::transaction::Trans
log::info!("---");
log::info!("Transaction:");
log::info!("{:#?}", transaction);
let bytes = transaction
.try_to_vec()
.expect("Transaction is not expected to fail on serialization");
let bytes =
borsh::to_vec(&transaction).expect("Transaction is not expected to fail on serialization");
log::info!("transaction byte array length: {}", bytes.len());
log::info!("---");
bytes
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ fn get_transport() -> Result<TransportNativeHID, NEARLedgerError> {
///
/// ```no_run
/// use near_ledger::sign_transaction;
/// use near_primitives::borsh::BorshSerialize;
/// use near_primitives::{borsh, borsh::BorshSerialize};
/// use slip10::BIP32Path;
/// use std::str::FromStr;
///
/// # fn main() {
/// # let near_unsigned_transaction = [10; 250];
/// let hd_path = BIP32Path::from_str("44'/397'/0'/0'/1'").unwrap();
/// let borsh_transaction = near_unsigned_transaction.try_to_vec().unwrap();
/// let borsh_transaction = borsh::to_vec(&near_unsigned_transaction).unwrap();
/// let signature = sign_transaction(borsh_transaction, hd_path).unwrap();
/// println!("{:#?}", signature);
/// # }
Expand Down

0 comments on commit 5d95e82

Please sign in to comment.