Commit 04ca834d4c14d798d139181b3acfab1cb812e43a

Authored by Marius Hanne
1 parent 6f32fa927d

fix specs

Showing 4 changed files with 8 additions and 0 deletions Side-by-side Diff

spec/bitcoin/key_spec.rb
... ... @@ -3,6 +3,7 @@
3 3 describe "Bitcoin::Key" do
4 4  
5 5 before do
  6 + Bitcoin.network = :bitcoin
6 7 @key_data = {
7 8 :priv => "2ebd3738f59ae4fd408d717bf325b4cb979a409b0153f6d3b4b91cdfe046fb1e",
8 9 :pub => "045fcb2fb2802b024f371cc22bc392268cc579e47e7936e0d1f05064e6e1103b8a81954eb6d3d33b8b6e73e9269013e843e83919f7ce4039bb046517a0cad5a3b1" }
... ... @@ -95,6 +96,7 @@
95 96 Bitcoin::OpenSSL_EC
96 97  
97 98 it 'resolves public from private key' do
  99 + Bitcoin.network = :testnet
98 100 privkey = ["56e28a425a7b588973b5db962a09b1aca7bdc4a7268cdd671d03c52a997255dc"].pack("H*")
99 101 pubkey = ["04324c6ebdcf079db6c9209a6b715b955622561262cde13a8a1df8ae0ef030eaa1552e31f8be90c385e27883a9d82780283d19507d7fa2e1e71a1d11bc3a52caf3"].pack("H*")
100 102  
spec/bitcoin/network_spec.rb
... ... @@ -3,6 +3,7 @@
3 3 describe 'Bitcoin::network' do
4 4  
5 5 it 'returns network descriptor' do
  6 + Bitcoin.network = :bitcoin
6 7 net = Bitcoin::network
7 8 net[:magic_head].should == "\xF9\xBE\xB4\xD9"
8 9 net[:address_version].should == "00"
spec/bitcoin/wallet/keygenerator_spec.rb
... ... @@ -6,6 +6,10 @@
6 6  
7 7 @target = ("\x00\xff" + "\x00"*30).unpack("H*")[0].to_i(16)
8 8  
  9 + before do
  10 + Bitcoin.network = :bitcoin
  11 + end
  12 +
9 13 it "should use random data if no seed given" do
10 14 g = KeyGenerator.new(nil, nil, @target)
11 15 g.seed.size.should == 64
spec/bitcoin/wallet/wallet_spec.rb
... ... @@ -43,6 +43,7 @@
43 43  
44 44  
45 45 before do
  46 + Bitcoin.network = :bitcoin
46 47 @storage = Mock.new
47 48 @key = Key.from_base58('5J2hn1E8KEXmQn5gqykzKotyCcHbKrVbe8fjegsfVXRdv6wwon8')
48 49 @addr = '1M89ZeWtmZmATzE3b6PHTBi8c7tGsg5xpo'