refactor: local store functions as send

This commit is contained in:
thesimplekid
2024-01-15 22:02:54 +00:00
parent 9135febd02
commit e891d67ba0
4 changed files with 5 additions and 3 deletions

View File

@@ -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);

View File

@@ -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>;

View File

@@ -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;

View File

@@ -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,