lib/zold/wts.rb in zold-ruby-sdk-0.2.2 vs lib/zold/wts.rb in zold-ruby-sdk-0.2.3

- old
+ new

@@ -1,8 +1,8 @@ # frozen_string_literal: true -# Copyright (c) 2018-2019 Yegor Bugayenko +# Copyright (c) 2018-2020 Yegor Bugayenko # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the 'Software'), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -29,11 +29,11 @@ require 'zold/txn' # WTS gateway. # # Author:: Yegor Bugayenko (yegor256@gmail.com) -# Copyright:: Copyright (c) 2018-2019 Yegor Bugayenko +# Copyright:: Copyright (c) 2018-2020 Yegor Bugayenko # License:: MIT class Zold::WTS # Fake implementation. class Fake def pull @@ -50,10 +50,14 @@ def pay(_keygap, _bnf, _amount, _details) 'job-id' end + def usd_rate + 5_000 + end + def find(_query) [] end def wait(_job, time: 5 * 60) @@ -218,10 +222,10 @@ def clean(http) error = (http.headers || {})['X-Zold-Error'] raise error unless error.nil? unless http.code == 200 || http.code == 302 - @log.debug(http.body) + @log.debug("HTTP response body: #{http.body}") raise "Unexpected response code #{http.code}" end http end end