Working test with block reward added

This commit is contained in:
Anton Gavrilov
2017-07-25 12:04:37 +02:00
parent 204a63a00e
commit 5086dc3024
10 changed files with 195 additions and 13 deletions

View File

@@ -215,8 +215,7 @@ impl<T> TraceDB<T> where T: DatabaseExtras {
block_number: BlockNumber,
tx_number: usize
) -> Vec<LocalizedTrace> {
let tx_hash = self.extras.transaction_hash(block_number, tx_number)
.expect("Expected to find transaction hash. Database is probably corrupted");
let tx_hash = self.extras.transaction_hash(block_number, tx_number);
let flat_traces: Vec<FlatTrace> = traces.into();
flat_traces.into_iter()
@@ -228,7 +227,11 @@ impl<T> TraceDB<T> where T: DatabaseExtras {
subtraces: trace.subtraces,
trace_address: trace.trace_address.into_iter().collect(),
transaction_number: tx_number,
transaction_hash: tx_hash.clone(),
transaction_hash: match tx_hash {
Some(hash) => hash.clone(),
/// None tx hash means non transaction's trace
None => 0.into(),
},
block_number: block_number,
block_hash: block_hash
}),