Skip to content

Commit

Permalink
debug orders
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Oct 25, 2023
1 parent b602642 commit e15f163
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions workers/handshake-manager/src/manager/internal_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ impl HandshakeExecutor {
log::info!("Running internal matching engine on order {order}");
// Lookup the order and its wallet
let (network_order, wallet) = self.fetch_order_and_wallet(&order).await?;
dbg!(wallet.orders.clone());
let my_order = wallet
.orders
.get(&network_order.id)
.ok_or_else(|| HandshakeManagerError::StateNotFound(ERR_NO_ORDER.to_string()))?;
dbg!(my_order.clone());
let (my_proof, my_witness) = self
.get_validity_proof_and_witness(&network_order.id)
.await
Expand Down Expand Up @@ -86,6 +88,10 @@ impl HandshakeExecutor {

// Match against each other order in the local book
for order_id in shuffled_indices.into_iter().map(|ind| &other_orders[ind]) {
dbg!("Order 1");
dbg!(order_id);
dbg!("Order 2");
dbg!(network_order.id);
// Same order
if network_order.id == *order_id {
continue;
Expand Down Expand Up @@ -190,6 +196,8 @@ impl HandshakeExecutor {
.await
.ok_or_else(|| HandshakeManagerError::StateNotFound(ERR_NO_ORDER.to_string()))?;

dbg!(order.clone());

let locked_wallet_index = self.global_state.read_wallet_index().await;
let wallet = match locked_wallet_index.get_wallet_for_order(&order.id) {
Some(wallet) => locked_wallet_index.get_wallet(&wallet).await,
Expand Down

0 comments on commit e15f163

Please sign in to comment.