lib/peatio/goldcash/blockchain.rb in peatio-goldcash-2.6.5 vs lib/peatio/goldcash/blockchain.rb in peatio-goldcash-2.6.6
- old
+ new
@@ -24,17 +24,17 @@
txs = build_transaction(tx).map do |ntx|
Peatio::Transaction.new(ntx.merge(block_number: block_number))
end
txs_array.append(*txs)
end.yield_self { |txs_array| Peatio::Block.new(block_number, txs_array) }
- rescue Goldcash::Client::Error => e
+ rescue Client::Error => e
raise Peatio::Blockchain::ClientError, e
end
def latest_block_number
client.json_rpc(:getblockcount)
- rescue Goldcash::Client::Error => e
+ rescue Client::Error => e
raise Peatio::Blockchain::ClientError, e
end
def load_balance_of_address!(address, _currency_id)
address_with_balance = client.json_rpc(:listaddressgroupings)
@@ -44,11 +44,11 @@
if address_with_balance.blank?
raise Peatio::Blockchain::UnavailableAddressBalanceError, address
end
address_with_balance[1].to_d
- rescue Goldcash::Client::Error => e
+ rescue Client::Error => e
raise Peatio::Blockchain::ClientError, e
end
private
@@ -71,10 +71,10 @@
end
end
end
def client
- @client ||= Goldcash::Client.new(settings_fetch(:server))
+ @client ||= Client.new(settings_fetch(:server))
end
def settings_fetch(key)
@settings.fetch(key) { raise Peatio::Blockchain::MissingSettingError, key.to_s }
end