mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
Move sc_tendermint to async sign
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
use core::{marker::PhantomData, ops::Deref};
|
use core::{marker::PhantomData, ops::Deref};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
||||||
|
use async_trait::async_trait;
|
||||||
|
|
||||||
use sp_application_crypto::{
|
use sp_application_crypto::{
|
||||||
RuntimePublic as PublicTrait, Pair as PairTrait,
|
RuntimePublic as PublicTrait, Pair as PairTrait,
|
||||||
sr25519::{Public, Pair, Signature},
|
sr25519::{Public, Pair, Signature},
|
||||||
@@ -92,12 +94,13 @@ impl<T: TendermintClient> TendermintValidators<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
impl<T: TendermintClient> SignatureScheme for TendermintValidators<T> {
|
impl<T: TendermintClient> SignatureScheme for TendermintValidators<T> {
|
||||||
type ValidatorId = u16;
|
type ValidatorId = u16;
|
||||||
type Signature = Signature;
|
type Signature = Signature;
|
||||||
type AggregateSignature = Vec<Signature>;
|
type AggregateSignature = Vec<Signature>;
|
||||||
|
|
||||||
fn sign(&self, msg: &[u8]) -> Signature {
|
async fn sign(&self, msg: &[u8]) -> Signature {
|
||||||
self.0.read().unwrap().keys.sign(msg)
|
self.0.read().unwrap().keys.sign(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user