2222 )
2323 end
2424
25- describe '#self .parse' do
25+ describe '.parse' do
2626 def parse ( *args )
2727 described_class . parse ( StringIO . new ( *args ) )
2828 end
@@ -52,21 +52,21 @@ def parse(*args)
5252 end
5353 end
5454
55- describe '#self .target_to_bits' do
55+ describe '.target_to_bits' do
5656 it 'returns a target integer back into bits' do
5757 expect ( described_class . target_to_bits ( 0x13ce9000000000000000000000000000000000000000000 ) )
5858 . to eq from_hex_to_bytes ( 'e93c0118' )
5959 end
6060 end
6161
62- describe '#self .bits_to_target' do
62+ describe '.bits_to_target' do
6363 it 'computes the target for the given bits' do
6464 expect ( described_class . bits_to_target ( block_header . bits ) )
6565 . to eq 0x13ce9000000000000000000000000000000000000000000
6666 end
6767 end
6868
69- describe '#self .calculate_new_bits' do
69+ describe '.calculate_new_bits' do
7070 it 'computes the new bits 2016-block time differential and the previous bits' do
7171 expect ( described_class . calculate_new_bits ( from_hex_to_bytes ( '54d80118' ) , 302400 ) )
7272 . to eq from_hex_to_bytes ( '00157617' )
@@ -85,37 +85,37 @@ def parse(*args)
8585
8686 describe '#bip9?' do
8787 context 'with bip9 block' do
88- it { expect ( block_header . bip9? ) . to eq true }
88+ it { expect ( block_header . bip9? ) . to be true }
8989 end
9090
9191 context 'with non bip9 block' do
9292 before { block_header . version = 0x01000000 }
9393
94- it { expect ( block_header . bip9? ) . to eq false }
94+ it { expect ( block_header . bip9? ) . to be false }
9595 end
9696 end
9797
9898 describe '#bip91?' do
9999 context 'with non bip91 block' do
100- it { expect ( block_header . bip91? ) . to eq false }
100+ it { expect ( block_header . bip91? ) . to be false }
101101 end
102102
103103 context 'with bip91 block' do
104104 before { block_header . version = 0x01000010 }
105105
106- it { expect ( block_header . bip91? ) . to eq true }
106+ it { expect ( block_header . bip91? ) . to be true }
107107 end
108108 end
109109
110110 describe '#bip141?' do
111111 context 'with bip141 block' do
112- it { expect ( block_header . bip141? ) . to eq true }
112+ it { expect ( block_header . bip141? ) . to be true }
113113 end
114114
115115 context 'with non bip141 block' do
116116 before { block_header . version = 0x01000000 }
117117
118- it { expect ( block_header . bip141? ) . to eq false }
118+ it { expect ( block_header . bip141? ) . to be false }
119119 end
120120 end
121121
@@ -129,13 +129,13 @@ def parse(*args)
129129
130130 describe '#pow_valid?' do
131131 context 'with valid PoW' do
132- it { expect ( block_header . pow_valid? ) . to eq true }
132+ it { expect ( block_header . pow_valid? ) . to be true }
133133 end
134134
135135 context 'with invalid PoW' do
136136 before { block_header . nonce = from_hex_to_bytes ( '00000000' ) }
137137
138- it { expect ( block_header . pow_valid? ) . to eq false }
138+ it { expect ( block_header . pow_valid? ) . to be false }
139139 end
140140 end
141141end
0 commit comments