lib/zold/patch.rb in zold-0.16.27 vs lib/zold/patch.rb in zold-0.16.28

- old
+ new

@@ -30,11 +30,11 @@ # Copyright:: Copyright (c) 2018 Yegor Bugayenko # License:: MIT module Zold # A patch class Patch - def initialize(wallets, log: Log::Quiet.new) + def initialize(wallets, log: Log::NULL) @wallets = wallets @txns = [] @log = log end @@ -79,10 +79,10 @@ if balance < txn.amount.to_i * -1 && !wallet.root? @log.error("Transaction ##{txn.id} attempts to make the balance of \ #{wallet.id}/#{Amount.new(zents: balance).to_zld}/#{@txns.size} negative: #{txn.to_text}") next end - unless Signature.new.valid?(@key, wallet.id, txn) + unless Signature.new(@network).valid?(@key, wallet.id, txn) @log.error("Invalid RSA signature at transaction ##{txn.id} of #{wallet.id}: #{txn.to_text}") next end else dup = @txns.find { |t| t.id == txn.id && t.bnf == txn.bnf && t.amount.positive? }