fix dup tx hashes in bencher

This commit is contained in:
Svyatoslav Nikolsky 2018-05-30 10:38:33 +03:00
parent 160e8c636f
commit 5b1ff06c14
2 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,7 @@ pub fn fetch(benchmark: &mut Benchmark) {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build()
@ -65,6 +66,7 @@ pub fn write(benchmark: &mut Benchmark) {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build()
@ -102,6 +104,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32 * 4).build()
@ -112,6 +115,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) {
let next_block_side = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(base).nonce(x as u32 * 4 + 2).build()
@ -122,6 +126,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) {
let next_block_side_continue = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(next_base).nonce(x as u32 * 4 + 3).build()
@ -131,6 +136,7 @@ pub fn reorg_short(benchmark: &mut Benchmark) {
let next_block_continue = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32 * 4 + 1).build()
@ -199,6 +205,7 @@ pub fn write_heavy(benchmark: &mut Benchmark) {
let next_block = test_data::block_builder()
.transaction()
.coinbase()
.lock_time(x as u32)
.output().value(5000000000).build()
.build()
.merkled_header().parent(rolling_hash.clone()).nonce(x as u32).build()

View File

@ -34,6 +34,7 @@ pub fn main(benchmark: &mut Benchmark) {
LittleEndian::write_u64(&mut coinbase_nonce[..], x as u64);
let next_block = test_data::block_builder()
.transaction()
.lock_time(x as u32)
.input()
.coinbase()
.signature_bytes(coinbase_nonce.to_vec().into())
@ -62,6 +63,7 @@ pub fn main(benchmark: &mut Benchmark) {
LittleEndian::write_u64(&mut coinbase_nonce[..], (b + BLOCKS_INITIAL) as u64);
let mut builder = test_data::block_builder()
.transaction()
.lock_time(b as u32)
.input().coinbase().signature_bytes(coinbase_nonce.to_vec().into()).build()
.output().value(5000000000).build()
.build();