objects/ops.rb
def pay_taxes(keygap)
    raise "The user @#{@user.login} is not registered yet" unless @item.exists?
    raise "The account @#{@user.login} is not confirmed yet" unless @user.confirmed?
    start = Time.now
    id = @item.id
    pull
    raise 'There is no wallet file after PULL, can\'t pay taxes' unless @wallets.acq(id, &:exists?)
    Tempfile.open do |f|
      File.write(f, @item.key(keygap))
      require 'zold/commands/taxes'
      Zold::Taxes.new(wallets: @wallets, remotes: @remotes, log: @log).run(
        ['taxes', 'pay', "--network=#{@network}", '--private-key=' + f.path, id.to_s]
      )
    end
    push
    @log.info("Taxes paid for #{id} in #{Zold::Age.new(start)}")
  end
# Pay all required taxes, no matter what is the amount.
Pay all required taxes, no matter what is the amount.
Pay all required taxes no matter what is the amount .
def pay_taxes(keygap)
    raise "The user @#{@user.login} is not registered yet" unless @item.exists?
    raise "The account @#{@user.login} is not confirmed yet" unless @user.confirmed?
    start = Time.now
    id = @item.id
    pull
    raise 'There is no wallet file after PULL, can\'t pay taxes' unless @wallets.acq(id, &:exists?)
    Tempfile.open do |f|
      File.write(f, @item.key(keygap))
      require 'zold/commands/taxes'
      Zold::Taxes.new(wallets: @wallets, remotes: @remotes, log: @log).run(
        ['taxes', 'pay', "--network=#{@network}", '--private-key=' + f.path, id.to_s]
      )
    end
    push
    @log.info("Taxes paid for #{id} in #{Zold::Age.new(start)}")
  end
def pay_taxes ( keygap ) raise "The user @#{@user.login} is not registered yet" unless @item . exists? raise "The account @#{@user.login} is not confirmed yet" unless @user . confirmed? start = Time . now id = @item . id pull raise 'There is no wallet file after PULL, can\'t pay taxes' unless @wallets . acq ( id , & :exists? ) Tempfile . open do | f | File . write ( f , @item . key ( keygap ) ) require 'zold/commands/taxes' Zold :: Taxes . new ( wallets : @wallets , remotes : @remotes , log : @log ) . run ( [ 'taxes' , 'pay' , "--network=#{@network}" , '--private-key=' + f . path , id . to_s ] ) end push @log . info ( "Taxes paid for #{id} in #{Zold::Age.new(start)}" ) end
Pay all required taxes, no matter what is the amount.
Pay all required taxes no matter what is the amount .
keygap