Sha256: 0197d77287bdd03d011c15d6a01a5456311681e49aef69dacbbdf357c7994584

Contents?: true

Size: 714 Bytes

Versions: 11

Compression:

Stored size: 714 Bytes

Contents

# encoding: ascii-8bit

require_relative '../spec_helper.rb'

include Bitcoin::Protocol

describe 'TxOut' do

  it '#initialize without specifying script_sig_length' do
    key = Bitcoin::Key.generate
    tx_out = TxOut.new(12345, Bitcoin::Script.from_string("OP_DUP OP_HASH160 #{key.hash160} OP_EQUALVERIFY OP_CHECKSIG").to_payload)
    lambda { tx_out.to_payload }.should.not.raise
  end

  it "should compare txouts" do
    o1 = Tx.new(fixtures_file('rawtx-01.bin')).out[0]
    o1_1 = TxOut.new(o1.value, o1.pk_script)
    o2 = Tx.new(fixtures_file('rawtx-02.bin')).out[0]

    (o1 == o1).should == true
    (o1 == o1_1).should == true
    (o1 == o2).should == false
    (o1 == nil).should == false
  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
monacoin-ruby-0.1.3 spec/bitcoin/protocol/txout_spec.rb
monacoin-ruby-0.1.2 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.14 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.13 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.12 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.11 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.10 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.9 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.8 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.7 spec/bitcoin/protocol/txout_spec.rb
bitcoin-ruby-0.0.6 spec/bitcoin/protocol/txout_spec.rb