mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-05 05:06:14 +01:00
refactor: local store functions as send
This commit is contained in:
@@ -54,7 +54,7 @@ impl MemoryLocalStore {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
#[async_trait]
|
||||
impl LocalStore for MemoryLocalStore {
|
||||
async fn add_active_keyset(&self, unit: CurrencyUnit, id: Id) -> Result<(), Error> {
|
||||
self.active_keysets.lock().await.insert(unit, id);
|
||||
|
||||
@@ -39,7 +39,7 @@ pub enum Error {
|
||||
Serde(#[from] serde_json::Error),
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
#[async_trait]
|
||||
pub trait LocalStore {
|
||||
async fn add_active_keyset(&self, unit: CurrencyUnit, id: Id) -> Result<(), Error>;
|
||||
async fn get_active_keyset_id(&self, unit: &CurrencyUnit) -> Result<Option<Id>, Error>;
|
||||
|
||||
@@ -44,7 +44,7 @@ impl RedbLocalStore {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait(?Send)]
|
||||
#[async_trait]
|
||||
impl LocalStore for RedbLocalStore {
|
||||
async fn add_active_keyset(&self, unit: CurrencyUnit, id: Id) -> Result<(), Error> {
|
||||
let db = self.db.lock().await;
|
||||
|
||||
@@ -54,6 +54,7 @@ pub enum Error {
|
||||
MultipleUnits,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Mint {
|
||||
// pub pubkey: PublicKey
|
||||
mnemonic: Mnemonic,
|
||||
@@ -559,6 +560,7 @@ impl Mint {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FeeReserve {
|
||||
pub min_fee_reserve: Amount,
|
||||
pub percent_fee_reserve: f32,
|
||||
|
||||
Reference in New Issue
Block a user