From 7b6b4865529bea44c2772e3b999a81c6dee98242 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Fri, 7 Jan 2022 16:29:04 -0800 Subject: [PATCH] updated env-sample --- .env-sample | 10 ++++++++-- api/logics.py | 4 ---- api/models.py | 6 ++++-- frontend/src/components/MakerPage.js | 2 +- frontend/src/components/OrderPage.js | 2 ++ .../components/{TradePipelineBox.js => TradeBox.js} | 0 6 files changed, 15 insertions(+), 9 deletions(-) rename frontend/src/components/{TradePipelineBox.js => TradeBox.js} (100%) diff --git a/.env-sample b/.env-sample index 2e88f3ec..a80d8ef6 100644 --- a/.env-sample +++ b/.env-sample @@ -10,8 +10,14 @@ BOND_SIZE = 0.01 MIN_TRADE = 10000 MAX_TRADE = 500000 -# Expiration time in minutes -EXPIRATION_MAKE = 5 +# Expiration time for HODL invoices and returning collateral in HOURS +BOND_EXPIRY = 8 +ESCROW_EXPIRY = 8 + +# Expiration time for locking collateral in MINUTES +EXP_MAKER_BOND_INVOICE = 300 +EXP_TAKER_BOND_INVOICE = 200 +EXP_TRADE_ESCR_INVOICE = 200 # Username for HTLCs escrows ESCROW_USERNAME = 'admin' \ No newline at end of file diff --git a/api/logics.py b/api/logics.py index 140f8ae1..7fad23ec 100644 --- a/api/logics.py +++ b/api/logics.py @@ -126,10 +126,6 @@ class Logics(): else: order.status = Order.Status.WFE - # If the order status was Payment Failed. Move forward to invoice Updated. - if order.status == Order.Status.FAI: - order.status = Order.Status.UPI - order.save() return True, None diff --git a/api/models.py b/api/models.py index d69cd767..464540de 100644 --- a/api/models.py +++ b/api/models.py @@ -99,7 +99,7 @@ class Order(models.Model): type = models.PositiveSmallIntegerField(choices=Types.choices, null=False) currency = models.PositiveSmallIntegerField(choices=Currencies.choices, null=False) amount = models.DecimalField(max_digits=9, decimal_places=4, validators=[MinValueValidator(0.00001)]) - payment_method = models.CharField(max_length=50, null=False, default="not specified", blank=True) + payment_method = models.CharField(max_length=35, null=False, default="not specified", blank=True) # order pricing method. A explicit amount of sats, or a relative premium above/below market. is_explicit = models.BooleanField(default=False, null=False) @@ -212,8 +212,9 @@ class MarketTick(models.Model): def log_a_tick(order): ''' - Adds a new tick + Creates a new tick ''' + if not order.taker_bond: return None @@ -227,6 +228,7 @@ class MarketTick(models.Model): volume=volume, premium=premium, currency=order.currency) + tick.save() def __str__(self): diff --git a/frontend/src/components/MakerPage.js b/frontend/src/components/MakerPage.js index 6b1ee1b1..8057e86a 100644 --- a/frontend/src/components/MakerPage.js +++ b/frontend/src/components/MakerPage.js @@ -178,7 +178,7 @@ export default class MakerPage extends Component { require={true} inputProps={{ style: {textAlign:"center"}, - maxLength: 50 + maxLength: 35 }} onChange={this.handlePaymentMethodChange} /> diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index 86ed50ec..8c806e93 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -98,6 +98,8 @@ export default class OrderPage extends Component { .then((data) => (console.log(data) & this.getOrderDetails(data.id))); } + + render (){ return ( diff --git a/frontend/src/components/TradePipelineBox.js b/frontend/src/components/TradeBox.js similarity index 100% rename from frontend/src/components/TradePipelineBox.js rename to frontend/src/components/TradeBox.js