Skip to content

Commit

Permalink
rebased with main
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswinder6991 committed May 17, 2024
1 parent eab8ffd commit b5ad317
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
32 changes: 15 additions & 17 deletions near-accounts/examples/multi-thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,22 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

let result = account
.function_call(&contract_id, method_name, args_json, gas, amount)
.await.expect("Reason")
.transact()
.await;
//.await.expect("Reason")
//.transact()
//.await;

// match result {
// Ok(res) => match &res.final_execution_outcome {
// Some(FinalExecutionOutcomeViewEnum::FinalExecutionOutcome(outcome)) => {
// println!("Final Execution outcome: {:?}", outcome);
// },
// Some(FinalExecutionOutcomeViewEnum::FinalExecutionOutcomeWithReceipt(outcome_receipt)) => {
// println!("Final Execution outcome with receipt: {:?}", outcome_receipt);
// },
// None => println!("No Final execution outcome."),
// },
// Err(err) => println!("Error: {:#?}", err),
// }
println!("Result - {:#?}",result);

match result {
Ok(res) => match &res.final_execution_outcome {
Some(FinalExecutionOutcomeViewEnum::FinalExecutionOutcome(outcome)) => {
println!("Final Execution outcome: {:#?}", outcome);
},
Some(FinalExecutionOutcomeViewEnum::FinalExecutionOutcomeWithReceipt(outcome_receipt)) => {
println!("Final Execution outcome with receipt: {:#?}", outcome_receipt);
},
None => println!("No Final execution outcome."),
},
Err(err) => println!("Error: {:#?}", err),
}
});

// You can do more work here or wait for the handle if needed
Expand Down
4 changes: 2 additions & 2 deletions near-accounts/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::sync::Arc;
#[derive(Clone)]
pub struct TransactionSender {
pub signed_transaction: SignedTransaction,
provider: Arc<dyn Provider>,
provider: Arc<dyn Provider + Send + Sync>,
}

impl TransactionSender {
Expand All @@ -40,7 +40,7 @@ impl TransactionSender {
/// # Returns
///
/// A new `Account` instance.
pub fn new(signed_transaction: SignedTransaction, provider: Arc<dyn Provider>) -> Self {
pub fn new(signed_transaction: SignedTransaction, provider: Arc<dyn Provider + Send + Sync>) -> Self {
Self {
signed_transaction,
provider,
Expand Down

0 comments on commit b5ad317

Please sign in to comment.