fix(debug): Adding debugging conosole.logs to bch-dex

This commit is contained in:
Chris Troutner
2025-05-09 13:15:39 -07:00
parent 6ef197dae3
commit 5f4b0c8da3
4 changed files with 7 additions and 3 deletions
+3
View File
@@ -468,6 +468,7 @@ class WalletAdapter {
async completeTx (hex, hdIndex) { async completeTx (hex, hdIndex) {
try { try {
// console.log('hex: ', hex) // console.log('hex: ', hex)
console.log('completeTx() hdIndex: ', hdIndex)
const bchjs = this.bchWallet.bchjs const bchjs = this.bchWallet.bchjs
@@ -492,6 +493,8 @@ class WalletAdapter {
// 'mainnet' // 'mainnet'
// ) // )
console.log('completeTx() this.walletInfo: ', this.walletInfo)
// Get the keypair for the address used in the Order // Get the keypair for the address used in the Order
const keyPair = await this.getKeyPair(hdIndex) const keyPair = await this.getKeyPair(hdIndex)
console.log(`maker keyPair: ${JSON.stringify(keyPair, null, 2)}`) console.log(`maker keyPair: ${JSON.stringify(keyPair, null, 2)}`)
+2 -2
View File
@@ -514,7 +514,7 @@ class OfferUseCases {
// This function is called by the P2WDB webhook REST API handler. When a // This function is called by the P2WDB webhook REST API handler. When a
// Counter Offer is passed to bch-dex by the P2WDB, the data is then passed // Counter Offer is passed to bch-dex by the P2WDB, the data is then passed
// to this function. It does due dilligence on the Counter Offer, then signs // to this function. It does due diligence on the Counter Offer, then signs
// and broadcasts the transaction to accept the Counter Offer. // and broadcasts the transaction to accept the Counter Offer.
async acceptCounterOffer (offerData) { async acceptCounterOffer (offerData) {
try { try {
@@ -535,7 +535,7 @@ class OfferUseCases {
let orderData = {} let orderData = {}
try { try {
orderData = await this.orderUseCase.findOrderByUtxo(offerData) orderData = await this.orderUseCase.findOrderByUtxo(offerData)
// console.log(`orderData: ${JSON.stringify(orderData, null, 2)}`) console.log(`orderData: ${JSON.stringify(orderData, null, 2)}`)
} catch (err) { } catch (err) {
console.log('Order matching this Counter Offer is not managed by this instance of bch-dex. Skipping.') console.log('Order matching this Counter Offer is not managed by this instance of bch-dex. Skipping.')
+1
View File
@@ -67,6 +67,7 @@ class OrderLib {
await userWallet.initialize() await userWallet.initialize()
// Specify the address to send payment. // Specify the address to send payment.
console.log('userWallet.walletInfo: ', userWallet.walletInfo)
entryObj.makerAddr = userWallet.walletInfo.cashAddress entryObj.makerAddr = userWallet.walletInfo.cashAddress
console.log('entryObj.makerAddr: ', entryObj.makerAddr) console.log('entryObj.makerAddr: ', entryObj.makerAddr)
// console.log('entryObj.makerAddr: ', entryObj.makerAddr) // console.log('entryObj.makerAddr: ', entryObj.makerAddr)
+1 -1
View File
@@ -1,6 +1,6 @@
import mongoose from 'mongoose' import mongoose from 'mongoose'
import config from '../../config/index.js' import config from '../../config/index.js'
import User from '../../src/models/users.js' import User from '../../src/adapters/localdb/models/users.js'
async function getUsers () { async function getUsers () {
// Connect to the Mongo Database. // Connect to the Mongo Database.