Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fixed #1606
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Jul 13, 2016
1 parent 420f2ad commit 71cd010
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ethcore/src/blooms/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use util::HeapSizeOf;
use basic_types::LogBloom;

/// Helper structure representing bloom of the trace.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct Bloom(LogBloom);

impl From<LogBloom> for Bloom {
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/blooms/bloom_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use util::HeapSizeOf;
use super::Bloom;

/// Represents group of X consecutive blooms.
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct BloomGroup {
blooms: Vec<Bloom>,
}
Expand Down
11 changes: 4 additions & 7 deletions ethcore/src/trace/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

//! Trace database.
use std::ptr;
use std::ops::{Deref, DerefMut};
use std::collections::HashMap;
use std::sync::{RwLock, Arc};
Expand Down Expand Up @@ -46,9 +45,7 @@ impl Key<BlockTraces> for H256 {
fn key(&self) -> H264 {
let mut result = H264::default();
result[0] = TraceDBIndex::BlockTraces as u8;
unsafe {
ptr::copy(self.as_ptr(), result.as_mut_ptr().offset(1), 32);
}
result[1..33].copy_from_slice(self);
result
}
}
Expand Down Expand Up @@ -83,9 +80,9 @@ impl Key<blooms::BloomGroup> for TraceGroupPosition {
result[0] = TraceDBIndex::BloomGroups as u8;
result[1] = self.0.level;
result[2] = self.0.index as u8;
result[3] = (self.0.index << 8) as u8;
result[4] = (self.0.index << 16) as u8;
result[5] = (self.0.index << 24) as u8;
result[3] = (self.0.index >> 8) as u8;
result[4] = (self.0.index >> 16) as u8;
result[5] = (self.0.index >> 24) as u8;
TraceGroupKey(result)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ethcore/src/types/trace_types/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::collections::VecDeque;
/// Addresses filter.
///
/// Used to create bloom possibilities and match filters.
#[derive(Binary)]
#[derive(Debug, Binary)]
pub struct AddressesFilter {
list: Vec<Address>
}
Expand Down Expand Up @@ -76,7 +76,7 @@ impl AddressesFilter {
}
}

#[derive(Binary)]
#[derive(Debug, Binary)]
/// Traces filter.
pub struct Filter {
/// Block range.
Expand Down
4 changes: 2 additions & 2 deletions rpc/src/v1/types/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub struct LocalizedTrace {
/// Result
result: Res,
/// Trace address
#[serde(rename="traceH160")]
#[serde(rename="traceAddress")]
trace_address: Vec<U256>,
/// Subtraces
subtraces: U256,
Expand Down Expand Up @@ -443,7 +443,7 @@ mod tests {
block_hash: H256::from(14),
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"action":{"call":{"from":"0x0000000000000000000000000000000000000004","to":"0x0000000000000000000000000000000000000005","value":"0x06","gas":"0x07","input":"0x1234"}},"result":{"call":{"gasUsed":"0x08","output":"0x5678"}},"traceH160":["0x0a"],"subtraces":"0x01","transactionPosition":"0x0b","transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":"0x0d","blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
assert_eq!(serialized, r#"{"action":{"call":{"from":"0x0000000000000000000000000000000000000004","to":"0x0000000000000000000000000000000000000005","value":"0x06","gas":"0x07","input":"0x1234"}},"result":{"call":{"gasUsed":"0x08","output":"0x5678"}},"traceAddress":["0x0a"],"subtraces":"0x01","transactionPosition":"0x0b","transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":"0x0d","blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
}

#[test]
Expand Down

0 comments on commit 71cd010

Please sign in to comment.