Skip to content

Commit

Permalink
single executor method
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaloup committed Jun 28, 2023
1 parent b337857 commit 429b238
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libs/marinade-client-rs/src/transaction_executors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,17 @@ where
}
Ok(())
}

pub fn execute_single<C: Deref<Target = dynsigner::DynSigner> + Clone>(
anchor_builder: RequestBuilder<C>,
rpc_client: &RpcClient,
simulate: bool,
) -> anyhow::Result<()> {
if !simulate {
let commitment_level = rpc_client.commitment().commitment;
log_execution(anchor_builder.execute(commitment_level))?;
} else {
log_simulation(anchor_builder.simulate(rpc_client))?;
}
Ok(())
}

0 comments on commit 429b238

Please sign in to comment.