Compare commits

..
1 Commits
Author SHA1 Message Date
Chris Troutner 94cfb4c785 Customizing for temp demo 2022-10-09 10:32:51 -07:00
3 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ RUN git clone https://github.com/Permissionless-Software-Foundation/bch-dex-ui-v
WORKDIR /home/safeuser/bch-dex-ui-v2
# For development: switch to unstable branch
RUN git checkout ct-unstable
RUN git checkout temp-demo
# Install dependencies
#RUN mkdir .ipfsdata
+4 -5
View File
@@ -306,7 +306,7 @@ class OfferUseCases {
console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
// Calculate amount of sats to generate a counter offer.
let satsToMove = Math.ceil(offerInfo.numTokens * parseInt(offerInfo.rateInBaseUnit))
let satsToMove = offerInfo.numTokens * parseInt(offerInfo.rateInBaseUnit)
if (isNaN(satsToMove)) {
throw new Error('Could not calculate the amount of BCH to generate counter offer')
}
@@ -385,7 +385,7 @@ class OfferUseCases {
// Sell Offer
// Calculate the sats needed
const satsNeeded = Math.ceil(offerEntity.numTokens * parseInt(offerEntity.rateInBaseUnit))
const satsNeeded = offerEntity.numTokens * parseInt(offerEntity.rateInBaseUnit)
if (isNaN(satsNeeded)) {
throw new Error('Could not calculate sats needed!')
}
@@ -467,7 +467,7 @@ class OfferUseCases {
console.log(`txObj: ${JSON.stringify(txObj, null, 2)}`)
// Ensure the 3rd output (vout=2) contains the required amount of BCH.
const satsToReceive = Math.ceil(orderData.numTokens * parseInt(orderData.rateInBaseUnit))
const satsToReceive = orderData.numTokens * parseInt(orderData.rateInBaseUnit)
if (isNaN(satsToReceive)) {
throw new Error('Could not calculate the amount of BCH offered in the Counter Offer')
}
@@ -579,8 +579,7 @@ class OfferUseCases {
}
// If the Offer UTXO is spent, delete the Offer model.
if (utxoStatus === false) {
console.log('utxoStatus: ', utxoStatus)
if (!utxoStatus) {
console.log(`Spent UTXO detected. Deleting this Offer: ${JSON.stringify(thisOffer, null, 2)}`)
await thisOffer.remove()
}
+1 -2
View File
@@ -235,8 +235,7 @@ class OrderLib {
}
// If the Order UTXO is spent, delete the Order model.
if (utxoStatus === false) {
console.log('utxoStatus: ', utxoStatus)
if (!utxoStatus) {
console.log(`Spent UTXO detected. Deleting this Order: ${JSON.stringify(thisOrder, null, 2)}`)
await thisOrder.remove()
}