From e05e2b7a211a04ef053955fa23b180a58f5effdb Mon Sep 17 00:00:00 2001 From: Peter Lampesberger Date: Sun, 20 Aug 2017 04:27:19 +0200 Subject: [PATCH] Add testnet blockchain adapters again --- lib/straight/gateway.rb | 4 ++++ spec/lib/gateway_spec.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/straight/gateway.rb b/lib/straight/gateway.rb index 90b9272..7d54561 100644 --- a/lib/straight/gateway.rb +++ b/lib/straight/gateway.rb @@ -78,6 +78,10 @@ def blockchain_adapters @blockchain_adapters end + def test_blockchain_adapters + @blockchain_adapters.map{ |el| el.class.testnet_adapter rescue next }.compact + end + # Creates a new order for the address derived from the pubkey and the keychain_id argument provided. # See explanation of this keychain_id argument is in the description for the AddressProvider::Base#new_address method. def new_order(args) diff --git a/spec/lib/gateway_spec.rb b/spec/lib/gateway_spec.rb index 80d7f9d..9a76882 100644 --- a/spec/lib/gateway_spec.rb +++ b/spec/lib/gateway_spec.rb @@ -145,6 +145,7 @@ it "is using testnet" do @gateway.test_mode = true allow(@mock_adapter).to receive(:testnet_adapters).and_return(true) + expect(@gateway.blockchain_adapters).to_not be nil expect(@gateway.blockchain_adapters).to eq(@gateway.test_blockchain_adapters) end