Sha256: d8071d50c8962c33ae6409e11d17a16a8bad759ab7d18de170de29d5587d67bd
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
module Stellar::Concerns module Transaction # Returns the string of bytes that, when hashed, provide the value which # should be signed to create a valid stellar transaction signature def signature_base signature_base_prefix + to_xdr end def sign(key_pair) key_pair.sign(hash) end def sign_decorated(key_pair) key_pair.sign_decorated(hash) end def hash Digest::SHA256.digest(signature_base) end def merge(other) cloned = Marshal.load Marshal.dump(self) cloned.operations += other.to_operations cloned end # # Extracts the operations from this single transaction, # setting the source account on the extracted operations. # # Useful for merging transactions. # # @return [Array<Operation>] the operations def to_operations cloned = Marshal.load Marshal.dump(operations) cloned.each do |op| op.source_account ||= source_account end end def apply_defaults self.operations ||= [] self.fee ||= 100 self.memo ||= Stellar::Memo.new(:memo_none) self.ext ||= Stellar::Transaction::Ext.new 0 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
stellar-base-0.26.0 | lib/stellar/concerns/transaction.rb |
stellar-base-0.25.0 | lib/stellar/concerns/transaction.rb |