diff --git a/CLAUDE.md b/CLAUDE.md index fd97de3..8d69ce6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,6 +88,17 @@ SELECT * FROM mps_crypto_payment WHERE id = 'payment-uuid-here'; ### UUID Objects Always use `uuid_str` when you need a string copy of the identifier. Models inherit `uuid_str` property from `RBase`. +## Development Standards and Expectations + +**CRITICAL WORK ETHIC**: The user pays significant money for development work and expects thorough, complete solutions. NEVER try to do the minimum or cut corners. When asked to implement features, provide comprehensive, production-ready implementations that consider all aspects of the request. + +**TESTING INTEGRITY**: NEVER skip, delete, or disable unit tests or integration tests when they break. When tests fail: +1. **FIX THE TESTS** - Update them to work with new functionality +2. **FIX THE CODE** - If the tests reveal actual bugs, fix the underlying issue +3. **ADD MORE TESTS** - Ensure new functionality is properly covered + +Disabling or removing tests weakens the codebase and is unacceptable. Tests are critical safety nets that prevent regressions. + ## Commit Message Guidelines **CRITICAL**: Do not include Claude Code attribution in commit messages. Attributing human work to Claude is inappropriate and misrepresents the actual authorship of the code. All code changes should be attributed to the human developer who reviewed, approved, and committed the work. \ No newline at end of file diff --git a/dogecoin-sweep-all.sh b/dogecoin-sweep-all.sh deleted file mode 100644 index 624265b..0000000 --- a/dogecoin-sweep-all.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -# Dogecoin Sweep All Script -# Sweeps ALL spendable DOGE funds to cold storage - -set -e # Exit on any error - -# Configuration -DOGECOIN_CLI="/opt/dogecoin/dogecoin-cli" -DOGECOIN_CONF="/opt/dogecoin/.dogecoin/dogecoin.conf" -DOGECOIN_DATADIR="/opt/dogecoin/.dogecoin" - -# Check if cold wallet address is provided -if [ -z "$COLD_WALLET_ADDRESS" ]; then - echo "ERROR: COLD_WALLET_ADDRESS environment variable not set!" - echo "Usage: COLD_WALLET_ADDRESS= ./dogecoin-sweep-all.sh" - exit 1 -fi - -echo "=== SWEEPING ALL DOGECOIN WALLET FUNDS TO COLD STORAGE ===" -echo "CAUTION: This will send ALL unlocked balance from wallet!" -echo "" - -# Check if dogecoin-cli is accessible -if [ ! -f "$DOGECOIN_CLI" ]; then - echo "❌ dogecoin-cli not found at $DOGECOIN_CLI" - exit 1 -fi - -# Check if config exists -if [ ! -f "$DOGECOIN_CONF" ]; then - echo "❌ Dogecoin config not found at $DOGECOIN_CONF" - exit 1 -fi - -echo "Checking wallet balance..." - -# Test connection and get balance -if ! balance=$($DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" getbalance 2>/dev/null); then - echo "❌ Dogecoin wallet not accessible. Is dogecoind running?" - echo "Check service status: systemctl status dogecoind" - exit 1 -fi - -unconfirmed=$($DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" getunconfirmedbalance 2>/dev/null || echo "0") - -# Check if there's balance to sweep -if [ "$(echo "$balance == 0" | bc -l)" = "1" ]; then - echo "No spendable balance to sweep!" - echo "Balance: $balance DOGE" - echo "Unconfirmed: $unconfirmed DOGE" - exit 1 -fi - -echo "Spendable balance: $balance DOGE" -echo "Unconfirmed: $unconfirmed DOGE" -echo "" -echo "Target address: $COLD_WALLET_ADDRESS" -echo "" - -# Confirmation prompt -read -p "Are you sure you want to sweep ALL spendable funds? (yes/no): " confirm -if [ "$confirm" != "yes" ]; then - echo "Cancelled." - exit 0 -fi - -echo "" -echo "Sweeping $balance DOGE to cold storage..." - -# Send all funds (subtract fee from amount so ALL funds are sent) -if txid=$($DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" sendtoaddress "$COLD_WALLET_ADDRESS" "$balance" "" "" true 2>/dev/null); then - echo "✓ Sweep successful!" - echo "Amount: $balance DOGE" - echo "Transaction ID: $txid" - echo "" - echo "New wallet balance:" - $DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" getbalance -else - echo "❌ Sweep failed!" - exit 1 -fi \ No newline at end of file diff --git a/make_post_sell/static/dogecoin-logo.png b/make_post_sell/static/dogecoin-logo.png new file mode 100644 index 0000000..8f649e8 Binary files /dev/null and b/make_post_sell/static/dogecoin-logo.png differ diff --git a/make_post_sell/static/monero-symbol-480.png b/make_post_sell/static/monero-symbol-480.png new file mode 100644 index 0000000..9cb993d Binary files /dev/null and b/make_post_sell/static/monero-symbol-480.png differ diff --git a/make_post_sell/templates/cart_checkout.j2 b/make_post_sell/templates/cart_checkout.j2 index 1386bfe..d2b7fb2 100644 --- a/make_post_sell/templates/cart_checkout.j2 +++ b/make_post_sell/templates/cart_checkout.j2 @@ -65,12 +65,12 @@ {% if monero_enabled and xmr_processor_enabled and cart.requires_payment and cart.shop_product_dict|length == 1 %}
{% if pending_crypto_quotes %} - + {% else %}
{% include "snippets/csrf.j2" %} - +
{% endif %} {% if not request.has_xmr_refund_address %} @@ -84,12 +84,12 @@ {% if dogecoin_enabled and doge_processor_enabled and cart.requires_payment and cart.shop_product_dict|length == 1 %}
{% if pending_crypto_quotes %} - + {% else %}
{% include "snippets/csrf.j2" %} - +
{% endif %} {% if not request.has_doge_refund_address %} diff --git a/make_post_sell/templates/crypto_checkout.j2 b/make_post_sell/templates/crypto_checkout.j2 index 9cd7c1d..7d46777 100644 --- a/make_post_sell/templates/crypto_checkout.j2 +++ b/make_post_sell/templates/crypto_checkout.j2 @@ -3,7 +3,14 @@ {% block content -%} {% include "snippets/csrf.j2" %}
-

{{ coin_name }} ({{ coin_symbol }}) Checkout

+

+ {% if coin_symbol == 'XMR' %} + + {% elif coin_symbol == 'DOGE' %} + + {% endif %} + {{ coin_name }} ({{ coin_symbol }}) Checkout +

{% if address and amount_crypto %} {% if coin_symbol == 'XMR' %} diff --git a/make_post_sell/tests/test_crypto_watcher.py b/make_post_sell/tests/test_crypto_watcher.py index 9eb22f3..ab37359 100644 --- a/make_post_sell/tests/test_crypto_watcher.py +++ b/make_post_sell/tests/test_crypto_watcher.py @@ -1917,7 +1917,12 @@ class PassiveMonitoringTests(unittest.TestCase): class PassiveMonitoringIntegrationTests(unittest.TestCase): - """Integration tests for passive wallet monitoring with real DB.""" + """Integration tests for passive wallet monitoring with real DB. + + Uses invoice=None because expired and cancelled payments automatically + delete their associated invoices, making None the correct state for + these passive monitoring scenarios. + """ def setUp(self): from make_post_sell import main @@ -1961,7 +1966,7 @@ class PassiveMonitoringIntegrationTests(unittest.TestCase): dbsession.add(processor) dbsession.flush() - # Create expired payment + # Create expired payment (invoice=None is correct - expired payments delete their invoices) self.expired_payment = CryptoPayment( invoice=None, user=user, @@ -1979,7 +1984,7 @@ class PassiveMonitoringIntegrationTests(unittest.TestCase): self.expired_payment.status = CryptoPayment.STATUS_EXPIRED dbsession.add(self.expired_payment) - # Create cancelled payment + # Create cancelled payment (invoice=None is correct - cancelled payments delete their invoices) self.cancelled_payment = CryptoPayment( invoice=None, user=user, diff --git a/sweep-all-doge.sh b/sweep-all-doge.sh deleted file mode 100755 index b2e9fbc..0000000 --- a/sweep-all-doge.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -# Dogecoin Sweep All Script -# Sweeps ALL spendable DOGE funds to cold storage - -set -e # Exit on any error - -# Configuration -DOGECOIN_CLI="/opt/dogecoin/dogecoin-cli" -DOGECOIN_CONF="/opt/dogecoin/.dogecoin/dogecoin.conf" -DOGECOIN_DATADIR="/opt/dogecoin/.dogecoin" - -# Check if cold wallet address is provided -if [ -z "$COLD_WALLET_ADDRESS" ]; then - echo "ERROR: COLD_WALLET_ADDRESS environment variable not set!" - echo "Usage: COLD_WALLET_ADDRESS= ./sweep-all-doge.sh" - exit 1 -fi - -echo "=== SWEEPING ALL DOGECOIN WALLET FUNDS TO COLD STORAGE ===" -echo "CAUTION: This will send ALL unlocked balance from wallet!" -echo "" - -# Check if dogecoin-cli is accessible -if [ ! -f "$DOGECOIN_CLI" ]; then - echo "❌ dogecoin-cli not found at $DOGECOIN_CLI" - exit 1 -fi - -# Check if config exists -if [ ! -f "$DOGECOIN_CONF" ]; then - echo "❌ Dogecoin config not found at $DOGECOIN_CONF" - exit 1 -fi - -echo "Checking wallet balance..." - -# Test connection and get balance -if ! balance=$($DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" getbalance 2>/dev/null); then - echo "❌ Dogecoin wallet not accessible. Is dogecoind running?" - echo "Check service status: systemctl status dogecoind" - exit 1 -fi - -unconfirmed=$($DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" getunconfirmedbalance 2>/dev/null || echo "0") - -# Check if there's balance to sweep -if [ "$(echo "$balance == 0" | bc -l)" = "1" ]; then - echo "No spendable balance to sweep!" - echo "Balance: $balance DOGE" - echo "Unconfirmed: $unconfirmed DOGE" - exit 1 -fi - -echo "Spendable balance: $balance DOGE" -echo "Unconfirmed: $unconfirmed DOGE" -echo "" -echo "Target address: $COLD_WALLET_ADDRESS" -echo "" - -# Confirmation prompt -read -p "Are you sure you want to sweep ALL spendable funds? (yes/no): " confirm -if [ "$confirm" != "yes" ]; then - echo "Cancelled." - exit 0 -fi - -echo "" -echo "Sweeping $balance DOGE to cold storage..." - -# Send all funds (subtract fee from amount so ALL funds are sent) -if txid=$($DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" sendtoaddress "$COLD_WALLET_ADDRESS" "$balance" "" "" true 2>/dev/null); then - echo "✓ Sweep successful!" - echo "Amount: $balance DOGE" - echo "Transaction ID: $txid" - echo "" - echo "New wallet balance:" - $DOGECOIN_CLI -conf="$DOGECOIN_CONF" -datadir="$DOGECOIN_DATADIR" getbalance -else - echo "❌ Sweep failed!" - exit 1 -fi \ No newline at end of file