---
lib/registration.rb | 13 +++++++++----
test/test_registration.rb | 2 +-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/lib/registration.rb b/lib/registration.rb
index 8252bb4..671fc4f 100644
--- a/lib/registration.rb
+++ b/lib/registration.rb
@@ -332,7 +332,7 @@ class Registration
def addr_and_rate
EMPromise.all([
self.crypto_addrs.then { |addrs|
- addrs.first || @customer.add_btc_address
+ addrs.first || self.add_crypto_addr
},
sell_prices.public_send(@customer.currency.to_s.downcase)
@@ -343,9 +343,6 @@ class Registration
class Bitcoin < CryptoPaymentMethod
Payment.kinds[:bitcoin] = method(:new)
- ## TODO: This constant seems unused?
- THIRTY_DAYS = 60 * 60 * 24 * 30
-
def reg_form_name
"registration/btc"
end
@@ -357,6 +354,10 @@ class Registration
def crypto_addrs
@customer.btc_addresses
end
+
+ def add_crypto_addr
+ @customer.add_btc_address
+ end
end
## Like Bitcoin
@@ -374,6 +375,10 @@ class Registration
def crypto_addrs
@customer.bch_addresses
end
+
+ def add_crypto_addr
+ @customer.add_bch_address
+ end
end
diff --git a/test/test_registration.rb b/test/test_registration.rb
index 4d0a566..9d7f0ff 100644
--- a/test/test_registration.rb
+++ b/test/test_registration.rb
@@ -665,7 +665,7 @@ class RegistrationTest < Minitest::Test
[Matching.new do |reply|
assert_equal :canceled, reply.status
assert_equal "1.000000", reply.form.field("amount").value
- assert_equal "testaddr", reply.form.field("btc_addresses").value
+ assert_equal "testaddr", reply.form.field("bch_addresses").value
true
end]
)
--
2.34.1