瀏覽代碼

refactor: local store functions as send

thesimplekid 1 年之前
父節點
當前提交
e891d67ba0

+ 1 - 1
crates/cashu-sdk/src/mint/localstore/memory.rs

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

+ 1 - 1
crates/cashu-sdk/src/mint/localstore/mod.rs

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

+ 1 - 1
crates/cashu-sdk/src/mint/localstore/redb_store.rs

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

+ 2 - 0
crates/cashu-sdk/src/mint/mod.rs

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