spec/bitcoin/protocol/tx_spec.rb in bitcoin-ruby-0.0.2 vs spec/bitcoin/protocol/tx_spec.rb in bitcoin-ruby-0.0.3

- old
+ new

@@ -174,10 +174,17 @@ tx = Bitcoin::P::Tx.from_json(fixtures_file('cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2.json')) tx.hash.should == "cd874fa8cb0e2ec2d385735d5e1fd482c4fe648533efb4c50ee53bda58e15ae2" outpoint_tx = Bitcoin::P::Tx.from_json(fixtures_file('514c46f0b61714092f15c8dfcb576c9f79b3f959989b98de3944b19d98832b58.json')) outpoint_tx.hash.should == "514c46f0b61714092f15c8dfcb576c9f79b3f959989b98de3944b19d98832b58" tx.verify_input_signature(0, outpoint_tx).should == true + + # OP_CHECKSIG with OP_0 from mainnet a6ce7081addade7676cd2af75c4129eba6bf5e179a19c40c7d4cf6a5fe595954 output 0 + tx = Bitcoin::P::Tx.from_json(fixtures_file('tx-9fb65b7304aaa77ac9580823c2c06b259cc42591e5cce66d76a81b6f51cc5c28.json')) + tx.hash.should == "9fb65b7304aaa77ac9580823c2c06b259cc42591e5cce66d76a81b6f51cc5c28" + outpoint_tx = Bitcoin::P::Tx.from_json(fixtures_file('tx-a6ce7081addade7676cd2af75c4129eba6bf5e179a19c40c7d4cf6a5fe595954.json')) + outpoint_tx.hash.should == "a6ce7081addade7676cd2af75c4129eba6bf5e179a19c40c7d4cf6a5fe595954" + tx.verify_input_signature(0, outpoint_tx).should == true end it '#sign_input_signature' do prev_tx = Tx.new( fixtures_file('rawtx-2f4a2717ec8c9f077a87dde6cbe0274d5238793a3f3f492b63c744837285e58a.bin') ) prev_tx.hash.should == "2f4a2717ec8c9f077a87dde6cbe0274d5238793a3f3f492b63c744837285e58a" @@ -241,11 +248,11 @@ it '#calculate_minimum_fee' do tx = Tx.new( fixtures_file('rawtx-b5d4e8883533f99e5903ea2cf001a133a322fa6b1370b18a16c57c946a40823d.bin') ) tx.minimum_relay_fee.should == 0 tx.minimum_block_fee.should == 0 tx = Tx.from_json(fixtures_file('bc179baab547b7d7c1d5d8d6f8b0cc6318eaa4b0dd0a093ad6ac7f5a1cb6b3ba.json')) - tx.minimum_relay_fee.should == 10_000 - tx.minimum_block_fee.should == 50_000 + tx.minimum_relay_fee.should == 0 + tx.minimum_block_fee.should == 10_000 end describe "Tx - BIP Scripts" do it "should do OP_CHECKMULTISIG" do