mirror of
https://github.com/serai-dex/serai.git
synced 2025-03-20 22:28:51 +00:00
Move sc_tendermint to async sign
This commit is contained in:
parent
2947ef08e3
commit
19154cf8e1
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue