mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-25 03:55:58 +00:00
cargo fmt signers/scanner
This commit is contained in:
parent
1b39138472
commit
b4e94f3d51
3 changed files with 147 additions and 141 deletions
|
@ -145,7 +145,8 @@ pub trait ScannerFeed: 'static + Send + Sync + Clone {
|
|||
getter: &(impl Send + Sync + Get),
|
||||
number: u64,
|
||||
) -> impl Send + Future<Output = Result<Self::Block, String>> {
|
||||
async move {let block = match self.unchecked_block_by_number(number).await {
|
||||
async move {
|
||||
let block = match self.unchecked_block_by_number(number).await {
|
||||
Ok(block) => block,
|
||||
Err(e) => Err(format!("couldn't fetch block {number}: {e:?}"))?,
|
||||
};
|
||||
|
@ -163,7 +164,8 @@ pub trait ScannerFeed: 'static + Send + Sync + Clone {
|
|||
}
|
||||
}
|
||||
|
||||
Ok(block)}
|
||||
Ok(block)
|
||||
}
|
||||
}
|
||||
|
||||
/// The dust threshold for the specified coin.
|
||||
|
|
|
@ -65,8 +65,10 @@ pub trait Coordinator: 'static + Send + Sync {
|
|||
) -> impl Send + Future<Output = Result<(), Self::EphemeralError>>;
|
||||
|
||||
/// Publish a `Batch`.
|
||||
fn publish_batch(&mut self, batch: Batch)
|
||||
-> impl Send + Future<Output = Result<(), Self::EphemeralError>>;
|
||||
fn publish_batch(
|
||||
&mut self,
|
||||
batch: Batch,
|
||||
) -> impl Send + Future<Output = Result<(), Self::EphemeralError>>;
|
||||
|
||||
/// Publish a `SignedBatch`.
|
||||
fn publish_signed_batch(
|
||||
|
|
|
@ -92,13 +92,15 @@ impl<D: Db, ST: SignableTransaction, P: TransactionPublisher<TransactionFor<ST>>
|
|||
impl<D: Db, ST: SignableTransaction, P: TransactionPublisher<TransactionFor<ST>>> ContinuallyRan
|
||||
for TransactionSignerTask<D, ST, P>
|
||||
{
|
||||
fn run_iteration(&mut self) -> impl Send + Future<Output = Result<bool, String>> {async{
|
||||
fn run_iteration(&mut self) -> impl Send + Future<Output = Result<bool, String>> {
|
||||
async {
|
||||
let mut iterated = false;
|
||||
|
||||
// Check for new transactions to sign
|
||||
loop {
|
||||
let mut txn = self.db.txn();
|
||||
let Some(tx) = TransactionsToSign::<ST>::try_recv(&mut txn, &self.keys[0].group_key()) else {
|
||||
let Some(tx) = TransactionsToSign::<ST>::try_recv(&mut txn, &self.keys[0].group_key())
|
||||
else {
|
||||
break;
|
||||
};
|
||||
iterated = true;
|
||||
|
@ -232,5 +234,5 @@ impl<D: Db, ST: SignableTransaction, P: TransactionPublisher<TransactionFor<ST>>
|
|||
|
||||
Ok(iterated)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue