base/lib/stellar/transaction_envelope.rb
# Checks to ensure that every signature for the envelope is
# a valid signature of one of the provided `key_pairs`
#
# NOTE: this does not do any authorization checks, which requires access to
# the current ledger state.
#
# @param key_pairs [Array<Stellar::KeyPair>] The key pairs to check the envelopes signatures against
#
# @return [Boolean] true if all signatures are from the provided key_pairs and validly sign the tx's hash
Checks to ensure that every signature for the envelope is
a valid signature of one of the provided `key_pairs`

this does not do any authorization checks, which requires access to
the current ledger state.
Checks to ensure that every signature for the envelope is a valid signature of one of the provided ` key_pairs ` this does not do any authorization checks which requires access to the current ledger state .
def signed_correctly?(*key_pairs)
      return false if signatures.empty?
      tx_hash = tx.hash
      keys_by_hint = key_pairs.index_by(&:signature_hint)
      signatures.all? do |sig|
        key_pair = keys_by_hint[sig.hint]
        break false if key_pair.nil?
        key_pair.verify(sig.signature, tx_hash)
      end
    end
def signed_correctly? ( * key_pairs ) return false if signatures . empty? tx_hash = tx . hash keys_by_hint = key_pairs . index_by ( & :signature_hint ) signatures . all? do | sig | key_pair = keys_by_hint [ sig . hint ] break false if key_pair . nil? key_pair . verify ( sig . signature , tx_hash ) end end
Checks to ensure that every signature for the envelope is
a valid signature of one of the provided `key_pairs`
Checks to ensure that every signature for the envelope is a valid signature of one of the provided ` key_pairs `
true if all signatures are from the provided key_pairs and validly sign the tx's hash
true if all signatures are from the provided key_pairs and validly sign the tx ' s hash
Boolean
key_pairs
The key pairs to check the envelopes signatures against
The key pairs to check the envelopes signatures against