Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomt1664 committed Jun 15, 2023
1 parent 6ff72e8 commit 68c9d5d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ pub trait Database {
fn get_statechain_id(&self, user_id: Uuid) -> Result<Uuid>;
fn get_owner_id(&self, statechain_id: Uuid) -> Result<Uuid>;
fn get_user_auth(&self, user_id: &Uuid) -> Result<String>;
fn get_user_value(&self, user_id: &Uuid) -> Result<u64>;
fn is_confirmed(&self, statechain_id: &Uuid) -> Result<bool>;
fn set_confirmed(&self, statechain_id: &Uuid) -> Result<()>;
fn get_challenge(&self, user_id: &Uuid) -> Result<Option<String>>;
Expand Down Expand Up @@ -284,6 +285,7 @@ pub trait Database {
finalized_data: TransferFinalizeData,
user_ids: Arc<Mutex<UserIDs>>
) -> Result<()>;
fn get_user_session_value(&self, user_id: Uuid) -> Result<Option<u64>>;
fn update_ecdsa_sign_first(
&self,
user_id: Uuid,
Expand Down
2 changes: 1 addition & 1 deletion server/src/protocol/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ pub mod tests {
use super::*;
use crate::protocol::util::{
mocks,
tests::{test_sc_entity, BACKUP_TX_NOT_SIGNED, BACKUP_TX_SIGNED},
tests::{test_sc_entity, test_sc_entity_pod, BACKUP_TX_NOT_SIGNED, BACKUP_TX_SIGNED},
};
use bitcoin::Transaction;
use std::str::FromStr;
Expand Down
4 changes: 2 additions & 2 deletions server/src/protocol/pay_on_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl POD for SCE {
pub fn pod_token_init(sc_entity: State<SCE>, value: u64) -> Result<Json<PODInfo>> {
sc_entity.check_rate_slow("pod_token_init")?;
let token_id = Uuid::new_v4();
match sc_entity.pod_token_init(token_id, &value, None) {
match sc_entity.pod_token_init(token_id, &value) {
Ok(res) => return Ok(Json(res)),
Err(e) => return Err(e),
}
Expand All @@ -189,7 +189,7 @@ pub fn pod_token_init(sc_entity: State<SCE>, value: u64) -> Result<Json<PODInfo>
pub fn pod_token_verify(sc_entity: State<SCE>, pod_token_id: String) -> Result<Json<PODStatus>> {
sc_entity.check_rate_fast("pod_token_verify")?;
let id = Uuid::from_str(&pod_token_id)?.into();
match sc_entity.pod_token_verify(None, &id) {
match sc_entity.pod_token_verify(&id) {
Ok(res) => return Ok(Json(res)),
Err(e) => return Err(e),
}
Expand Down
1 change: 1 addition & 0 deletions server/src/storage/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct HDPos {
pub enum Schema {
StateChainEntity,
Watcher,
PayOnDemand
}
impl Schema {
pub fn to_string(&self) -> String {
Expand Down
10 changes: 8 additions & 2 deletions server/src/storage/monotree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,10 @@ impl Database for MemoryDB {
}
fn set_confirmed(&self, _statechain_id: &uuid::Uuid) -> crate::Result<()> {
unimplemented!()
}
}
fn get_user_value(&self, _user_id: &uuid::Uuid) -> crate::Result<u64> {
unimplemented!()
}
fn get_challenge(&self, _user_id: &uuid::Uuid) -> crate::Result<Option<String>> {
unimplemented!()
}
Expand Down Expand Up @@ -714,7 +717,7 @@ impl Database for MemoryDB {
_user_id: &uuid::Uuid,
_auth: &String,
_proof_key: &String,
_challenge: &String,
_challenge: &Option<String>,
_user_ids: Arc<Mutex<UserIDs>>,
_value: &Option<u64>,
) -> crate::Result<()> {
Expand All @@ -730,6 +733,9 @@ impl Database for MemoryDB {
) -> crate::Result<()> {
unimplemented!()
}
fn get_user_session_value(&self, _user_id: uuid::Uuid) -> crate::Result<Option<u64>> {
unimplemented!()
}
fn transfer_init_user_session(
&self,
_new_user_id: &uuid::Uuid,
Expand Down

0 comments on commit 68c9d5d

Please sign in to comment.