openethereum/rpc/src/v1/types/trace.rs

874 lines
24 KiB
Rust
Raw Normal View History

// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity Ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
2016-06-06 00:24:21 +02:00
use std::collections::BTreeMap;
use ethcore::client::Executed;
use ethcore::trace as et;
use ethcore::trace::{FlatTrace, LocalizedTrace as EthLocalizedTrace, trace, TraceError};
use ethereum_types::{H160, H256, U256};
use serde::ser::SerializeStruct;
use serde::{Serialize, Serializer};
use types::account_diff;
use types::state_diff;
use vm;
use v1::types::Bytes;
#[derive(Debug, Serialize)]
/// A diff of some chunk of memory.
pub struct MemoryDiff {
/// Offset into memory the change begins.
pub off: usize,
/// The changed data.
pub data: Bytes,
}
impl From<et::MemoryDiff> for MemoryDiff {
fn from(c: et::MemoryDiff) -> Self {
MemoryDiff {
off: c.offset,
data: c.data.into(),
}
}
}
#[derive(Debug, Serialize)]
/// A diff of some storage value.
pub struct StorageDiff {
/// Which key in storage is changed.
pub key: U256,
/// What the value has been changed to.
pub val: U256,
}
impl From<et::StorageDiff> for StorageDiff {
fn from(c: et::StorageDiff) -> Self {
StorageDiff {
key: c.location,
val: c.value,
}
}
}
#[derive(Debug, Serialize)]
/// A record of an executed VM operation.
pub struct VMExecutedOperation {
/// The total gas used.
pub used: u64,
/// The stack item placed, if any.
pub push: Vec<U256>,
/// If altered, the memory delta.
pub mem: Option<MemoryDiff>,
/// The altered storage value, if any.
pub store: Option<StorageDiff>,
}
impl From<et::VMExecutedOperation> for VMExecutedOperation {
fn from(c: et::VMExecutedOperation) -> Self {
VMExecutedOperation {
used: c.gas_used.low_u64(),
push: c.stack_push.into_iter().map(Into::into).collect(),
mem: c.mem_diff.map(Into::into),
store: c.store_diff.map(Into::into),
}
}
}
#[derive(Debug, Serialize)]
/// A record of the execution of a single VM operation.
pub struct VMOperation {
/// The program counter.
pub pc: usize,
/// The gas cost for this instruction.
pub cost: u64,
/// Information concerning the execution of the operation.
pub ex: Option<VMExecutedOperation>,
/// Subordinate trace of the CALL/CREATE if applicable.
2016-08-23 10:10:12 +02:00
#[serde(bound="VMTrace: Serialize")]
pub sub: Option<VMTrace>,
}
impl From<(et::VMOperation, Option<et::VMTrace>)> for VMOperation {
fn from(c: (et::VMOperation, Option<et::VMTrace>)) -> Self {
VMOperation {
pc: c.0.pc,
cost: c.0.gas_cost.low_u64(),
ex: c.0.executed.map(Into::into),
sub: c.1.map(Into::into),
}
}
}
#[derive(Debug, Serialize)]
/// A record of a full VM trace for a CALL/CREATE.
pub struct VMTrace {
/// The code to be executed.
pub code: Bytes,
/// The operations executed.
pub ops: Vec<VMOperation>,
}
impl From<et::VMTrace> for VMTrace {
fn from(c: et::VMTrace) -> Self {
let mut subs = c.subs.into_iter();
let mut next_sub = subs.next();
VMTrace {
code: c.code.into(),
ops: c.operations
.into_iter()
.enumerate()
.map(|(i, op)| (op, {
let have_sub = next_sub.is_some() && next_sub.as_ref().unwrap().parent_step == i;
if have_sub {
let r = next_sub.clone();
next_sub = subs.next();
r
} else { None }
}).into())
.collect(),
}
}
}
2016-06-06 00:24:21 +02:00
#[derive(Debug, Serialize)]
/// Aux type for Diff::Changed.
pub struct ChangedType<T> where T: Serialize {
from: T,
to: T,
}
#[derive(Debug, Serialize)]
/// Serde-friendly `Diff` shadow.
pub enum Diff<T> where T: Serialize {
#[serde(rename = "=")]
2016-06-06 00:24:21 +02:00
Same,
#[serde(rename = "+")]
2016-06-06 00:24:21 +02:00
Born(T),
#[serde(rename = "-")]
2016-06-06 00:24:21 +02:00
Died(T),
#[serde(rename = "*")]
2016-06-06 00:24:21 +02:00
Changed(ChangedType<T>),
}
2017-10-16 18:18:43 +02:00
impl<T, U> From<account_diff::Diff<T>> for Diff<U> where T: Eq, U: Serialize + From<T> {
2016-06-06 00:24:21 +02:00
fn from(c: account_diff::Diff<T>) -> Self {
match c {
account_diff::Diff::Same => Diff::Same,
account_diff::Diff::Born(t) => Diff::Born(t.into()),
account_diff::Diff::Died(t) => Diff::Died(t.into()),
account_diff::Diff::Changed(t, u) => Diff::Changed(ChangedType{from: t.into(), to: u.into()}),
}
}
}
#[derive(Debug, Serialize)]
/// Serde-friendly `AccountDiff` shadow.
pub struct AccountDiff {
pub balance: Diff<U256>,
pub nonce: Diff<U256>,
pub code: Diff<Bytes>,
pub storage: BTreeMap<H256, Diff<H256>>,
}
impl From<account_diff::AccountDiff> for AccountDiff {
fn from(c: account_diff::AccountDiff) -> Self {
AccountDiff {
balance: c.balance.into(),
nonce: c.nonce.into(),
code: c.code.into(),
storage: c.storage.into_iter().map(|(k, v)| (k, v.into())).collect(),
2016-06-06 00:24:21 +02:00
}
}
}
#[derive(Debug)]
2016-06-06 00:24:21 +02:00
/// Serde-friendly `StateDiff` shadow.
pub struct StateDiff(BTreeMap<H160, AccountDiff>);
2016-06-06 00:24:21 +02:00
impl Serialize for StateDiff {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2016-06-06 00:24:21 +02:00
where S: Serializer {
Serialize::serialize(&self.0, serializer)
}
}
impl From<state_diff::StateDiff> for StateDiff {
fn from(c: state_diff::StateDiff) -> Self {
StateDiff(c.raw.into_iter().map(|(k, v)| (k, v.into())).collect())
2016-06-06 00:24:21 +02:00
}
}
/// Create response
#[derive(Debug, Serialize)]
pub struct Create {
/// Sender
from: H160,
/// Value
value: U256,
/// Gas
gas: U256,
/// Initialization code
init: Bytes,
}
impl From<trace::Create> for Create {
fn from(c: trace::Create) -> Self {
Create {
from: c.from,
value: c.value,
gas: c.gas,
init: Bytes::new(c.init),
}
}
}
/// Call type.
#[derive(Debug, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum CallType {
/// None
None,
/// Call
Call,
/// Call code
CallCode,
/// Delegate call
DelegateCall,
2017-06-19 11:41:46 +02:00
/// Static call
StaticCall,
}
impl From<vm::CallType> for CallType {
fn from(c: vm::CallType) -> Self {
match c {
vm::CallType::None => CallType::None,
vm::CallType::Call => CallType::Call,
vm::CallType::CallCode => CallType::CallCode,
vm::CallType::DelegateCall => CallType::DelegateCall,
vm::CallType::StaticCall => CallType::StaticCall,
}
}
}
/// Call response
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Call {
/// Sender
from: H160,
/// Recipient
to: H160,
/// Transfered Value
value: U256,
/// Gas
gas: U256,
/// Input data
input: Bytes,
/// The type of the call.
call_type: CallType,
}
impl From<trace::Call> for Call {
fn from(c: trace::Call) -> Self {
Call {
from: c.from,
to: c.to,
value: c.value,
gas: c.gas,
input: c.input.into(),
call_type: c.call_type.into(),
}
}
}
/// Reward type.
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum RewardType {
/// Block
Block,
/// Uncle
Uncle,
/// EmptyStep (AuthorityRound)
EmptyStep,
/// External (attributed as part of an external protocol)
External,
}
impl From<trace::RewardType> for RewardType {
fn from(c: trace::RewardType) -> Self {
match c {
trace::RewardType::Block => RewardType::Block,
trace::RewardType::Uncle => RewardType::Uncle,
trace::RewardType::EmptyStep => RewardType::EmptyStep,
trace::RewardType::External => RewardType::External,
}
}
}
/// Reward action
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Reward {
2017-07-31 12:06:38 +02:00
/// Author's address.
pub author: H160,
/// Reward amount.
pub value: U256,
/// Reward type.
pub reward_type: RewardType,
}
impl From<trace::Reward> for Reward {
fn from(r: trace::Reward) -> Self {
Reward {
author: r.author,
value: r.value,
reward_type: r.reward_type.into(),
}
}
}
/// Suicide
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Suicide {
/// Address.
pub address: H160,
/// Refund address.
pub refund_address: H160,
/// Balance.
pub balance: U256,
}
impl From<trace::Suicide> for Suicide {
fn from(s: trace::Suicide) -> Self {
Suicide {
address: s.address,
refund_address: s.refund_address,
balance: s.balance,
}
}
}
/// Action
#[derive(Debug)]
pub enum Action {
/// Call
Call(Call),
/// Create
Create(Create),
/// Suicide
Suicide(Suicide),
/// Reward
2017-10-16 18:18:43 +02:00
Reward(Reward),
}
impl From<trace::Action> for Action {
fn from(c: trace::Action) -> Self {
match c {
trace::Action::Call(call) => Action::Call(call.into()),
trace::Action::Create(create) => Action::Create(create.into()),
trace::Action::Suicide(suicide) => Action::Suicide(suicide.into()),
trace::Action::Reward(reward) => Action::Reward(reward.into()),
}
}
}
/// Call Result
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CallResult {
/// Gas used
gas_used: U256,
/// Output bytes
output: Bytes,
}
impl From<trace::CallResult> for CallResult {
fn from(c: trace::CallResult) -> Self {
CallResult {
gas_used: c.gas_used,
output: c.output.into(),
}
}
}
/// Craete Result
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateResult {
/// Gas used
gas_used: U256,
/// Code
code: Bytes,
/// Assigned address
address: H160,
}
impl From<trace::CreateResult> for CreateResult {
fn from(c: trace::CreateResult) -> Self {
CreateResult {
gas_used: c.gas_used,
code: c.code.into(),
address: c.address,
}
}
}
/// Response
#[derive(Debug)]
pub enum Res {
/// Call
Call(CallResult),
/// Create
Create(CreateResult),
/// Call failure
FailedCall(TraceError),
/// Creation failure
FailedCreate(TraceError),
/// None
None,
}
impl From<trace::Res> for Res {
fn from(t: trace::Res) -> Self {
match t {
trace::Res::Call(call) => Res::Call(CallResult::from(call)),
trace::Res::Create(create) => Res::Create(CreateResult::from(create)),
trace::Res::FailedCall(error) => Res::FailedCall(error),
trace::Res::FailedCreate(error) => Res::FailedCreate(error),
trace::Res::None => Res::None,
}
}
}
/// Trace
#[derive(Debug)]
2016-06-02 13:50:50 +02:00
pub struct LocalizedTrace {
/// Action
action: Action,
/// Result
result: Res,
/// Trace address
trace_address: Vec<usize>,
/// Subtraces
subtraces: usize,
/// Transaction position
transaction_position: Option<usize>,
/// Transaction hash
transaction_hash: Option<H256>,
/// Block Number
block_number: u64,
/// Block Hash
block_hash: H256,
}
impl Serialize for LocalizedTrace {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer
{
let mut struc = serializer.serialize_struct("LocalizedTrace", 9)?;
match self.action {
Action::Call(ref call) => {
struc.serialize_field("type", "call")?;
struc.serialize_field("action", call)?;
},
Action::Create(ref create) => {
struc.serialize_field("type", "create")?;
struc.serialize_field("action", create)?;
},
Action::Suicide(ref suicide) => {
struc.serialize_field("type", "suicide")?;
struc.serialize_field("action", suicide)?;
},
Action::Reward(ref reward) => {
struc.serialize_field("type", "reward")?;
struc.serialize_field("action", reward)?;
},
}
match self.result {
Res::Call(ref call) => struc.serialize_field("result", call)?,
Res::Create(ref create) => struc.serialize_field("result", create)?,
Res::FailedCall(ref error) => struc.serialize_field("error", &error.to_string())?,
Res::FailedCreate(ref error) => struc.serialize_field("error", &error.to_string())?,
Res::None => struc.serialize_field("result", &None as &Option<u8>)?,
}
struc.serialize_field("traceAddress", &self.trace_address)?;
struc.serialize_field("subtraces", &self.subtraces)?;
struc.serialize_field("transactionPosition", &self.transaction_position)?;
struc.serialize_field("transactionHash", &self.transaction_hash)?;
struc.serialize_field("blockNumber", &self.block_number)?;
struc.serialize_field("blockHash", &self.block_hash)?;
struc.end()
}
}
2016-06-02 13:50:50 +02:00
impl From<EthLocalizedTrace> for LocalizedTrace {
fn from(t: EthLocalizedTrace) -> Self {
LocalizedTrace {
action: t.action.into(),
result: t.result.into(),
trace_address: t.trace_address.into_iter().map(Into::into).collect(),
subtraces: t.subtraces,
transaction_position: t.transaction_number.map(Into::into),
transaction_hash: t.transaction_hash.map(Into::into),
block_number: t.block_number,
block_hash: t.block_hash,
}
}
}
2016-06-02 13:50:50 +02:00
/// Trace
#[derive(Debug)]
2016-06-02 13:50:50 +02:00
pub struct Trace {
/// Trace address
trace_address: Vec<usize>,
/// Subtraces
subtraces: usize,
2016-06-02 13:50:50 +02:00
/// Action
action: Action,
/// Result
result: Res,
}
impl Serialize for Trace {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer
{
let mut struc = serializer.serialize_struct("Trace", 4)?;
match self.action {
Action::Call(ref call) => {
struc.serialize_field("type", "call")?;
struc.serialize_field("action", call)?;
},
Action::Create(ref create) => {
struc.serialize_field("type", "create")?;
struc.serialize_field("action", create)?;
},
Action::Suicide(ref suicide) => {
struc.serialize_field("type", "suicide")?;
struc.serialize_field("action", suicide)?;
},
Action::Reward(ref reward) => {
struc.serialize_field("type", "reward")?;
struc.serialize_field("action", reward)?;
},
}
match self.result {
Res::Call(ref call) => struc.serialize_field("result", call)?,
Res::Create(ref create) => struc.serialize_field("result", create)?,
Res::FailedCall(ref error) => struc.serialize_field("error", &error.to_string())?,
Res::FailedCreate(ref error) => struc.serialize_field("error", &error.to_string())?,
Res::None => struc.serialize_field("result", &None as &Option<u8>)?,
}
struc.serialize_field("traceAddress", &self.trace_address)?;
struc.serialize_field("subtraces", &self.subtraces)?;
struc.end()
}
}
impl From<FlatTrace> for Trace {
fn from(t: FlatTrace) -> Self {
2016-06-02 13:50:50 +02:00
Trace {
trace_address: t.trace_address.into_iter().map(Into::into).collect(),
subtraces: t.subtraces,
2016-06-02 13:50:50 +02:00
action: t.action.into(),
result: t.result.into(),
}
}
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
/// A diff of some chunk of memory.
pub struct TraceResults {
/// The output of the call/create
pub output: Bytes,
/// The transaction trace.
pub trace: Vec<Trace>,
/// The transaction trace.
pub vm_trace: Option<VMTrace>,
/// The transaction trace.
pub state_diff: Option<StateDiff>,
}
impl From<Executed> for TraceResults {
fn from(t: Executed) -> Self {
TraceResults {
output: t.output.into(),
trace: t.trace.into_iter().map(Into::into).collect(),
vm_trace: t.vm_trace.map(Into::into),
state_diff: t.state_diff.map(Into::into),
}
}
}
Transactions hashes missing in trace_replayBlockTransactions method result #8725 (#8883) * Squashed commit of the following: commit 1f85076fd584365f1acbbafef5c8bdee722b479b Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:40:12 2018 +0200 update commit 63363cca7354873a8abe3b631b8b7dbd9da6ce1e Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:36:25 2018 +0200 Update commit e05caddc170a4cf0e476c23d443f07184dcb4fb1 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 10:04:34 2018 +0200 Test commit b0be065eadd0f2dd70f6613c50cbf3eb16d693ec Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 09:19:57 2018 +0200 test_client edit commit 949205ccdbac75f730639e5f0d8e1bdd9436de1d Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 05:14:53 2018 +0200 Edit Test commit 7cd44ee379a1e847f3e7d225444e72775bdbd4b5 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 04:25:22 2018 +0200 Updates commit e90de71e698d29475e8ba5696664b7d7bb335f9c Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 13:53:15 2018 +0200 Test commit 12a76381561b66ecf6ea636d7eebe43d2dcb7731 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 11:43:39 2018 +0200 Edited Tests commit 6c21e6de2da24e7b9f33ac8b82abb0b39488bd60 Merge: 87c4c74b8 9550cf766 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 87c4c74b8f769c8e4b55ba78b5aa1d6716413f6d Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:13 2018 +0200 Avoided Changing non-RPC Types commit 9550cf76610953c8492cc9473e4b9f876e770b70 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:29:03 2018 +0200 Update traces.rs commit 3e0b0ef29685b62f0917b80a48054b3379d59a50 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:27:44 2018 +0200 Update trace.rs commit 5078d67a2da7268db2a1064540a3c887e1f1a3cd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:26:08 2018 +0200 Update traces.rs commit 28f5ba1b035c6919ac11089cf1bdd703c75f0dbd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:24:04 2018 +0200 Update parity.rs commit 3b86b98ab5860efa61a7cc6a2b20e6c5c0f859cb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:23:33 2018 +0200 Update eth.rs commit bcad5a40f14a3c5d2d901ae1a9bed87949ab9c66 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:21:43 2018 +0200 Update call_analytics.rs commit e9029e0b8158387b606132b264652d285483870f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:56 2018 +0200 Update transaction.rs commit 0dacc81779bc62713e3f8e405229dfd7f89f33e8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:01 2018 +0200 Update executive.rs commit 3921d4ec77f49460d45603111b98cc07d3c235a0 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:18:39 2018 +0200 Update executed.rs commit 8416df654ebf6f68ad04c8a4a89a29ce704f9ca1 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:17:34 2018 +0200 Update client.rs commit cf0b4dddbc93395bc5ce1f17c3c07a294bf8dd49 Merge: 23bfa78c2 36e05e5f3 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:54:04 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 23bfa78c2662d697018e7061ab9ad0b864fde0ef Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:53:50 2018 +0200 Undo commit 36e05e5f30c35bd6b57af50fd337f2006df51b86 Merge: 2f6e1ef64 0afc74825 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:33 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 2f6e1ef64763a79ad2ed8baa2aed5a8f3136bafc Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:22 2018 +0200 Another rpc test output with ("transactionHash":null) commit 0afc74825828f724d68f3e444655b872a6c51ce0 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 07:18:45 2018 +0200 Another rpc test output with ("transactionHash":null) commit 138fbac9f02841adfeaaf061c5dd9e647f725e12 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 06:30:41 2018 +0200 Edited some rpc tests output with ("transactionHash":null) commit 8c129a63109c00f88ce36bad10699dc2f3237d95 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:48:39 2018 +0200 Update traces.rs commit 52c17f6191740637c1d1589a420996dccefe16bb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:47:29 2018 +0200 Update parity.rs commit d39303aa8c2097ba9e2ed94c7ad2166bf1608d3f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:46:25 2018 +0200 Update eth.rs commit 49be84bf529c33dc47c8260435fd0d26e137c66d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:40:56 2018 +0200 Update trace.rs commit 4fc801377fb01ff11867f66b547a307c162d7a56 Merge: d34ba2351 544210439 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 05:12:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 54421043959e14a76f309fe87d3c7513a95999f8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:04:51 2018 +0200 Update trace.rs commit 2b2524a31119d741df4076e9d1b3ce8f0b17b479 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:01:47 2018 +0200 Update state_diff.rs commit 2bf9982b8ce29ef69f116142eaeacf3049f7db49 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:50 2018 +0200 Update transaction.rs commit da696ea192c0f89cceb38834f6efee280129048c Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:13 2018 +0200 Update mod.rs commit cfc194ca0f44bfabec01a52897a322ea5a91930b Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:59:18 2018 +0200 Update pod_state.rs commit 3b3156853535a666778e0ad0e902de79fb138f1d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:57:37 2018 +0200 Update client.rs commit d34ba235132c654da6c2ed6ff0dcf96fda0c45ee Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 04:53:50 2018 +0200 RPC Only commit 8b5c4f19727549ee6f180a6effc228b2693509e9 Merge: 744491632 291b4a01b Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:55:14 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 74449163222e0ab75c704ac0ad424870e3c321d9 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:27:13 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 commit 291b4a01be6771acff8f5829c5406fa193665dbe Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 01:18:18 2018 +0200 Edited to make changes to RPC types only To make a transactions hash trace with "trace_replayBlockTransactions" add "transactionHash" to parameters commit 9d082bece73beb8ebddfda51fa5ec279f30b7bea Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 13 09:15:56 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 * update * Removed unwrap_or * Update * test_client update
2018-07-10 16:38:13 +02:00
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
Transactions hashes missing in trace_replayBlockTransactions method result #8725 (#8883) * Squashed commit of the following: commit 1f85076fd584365f1acbbafef5c8bdee722b479b Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:40:12 2018 +0200 update commit 63363cca7354873a8abe3b631b8b7dbd9da6ce1e Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:36:25 2018 +0200 Update commit e05caddc170a4cf0e476c23d443f07184dcb4fb1 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 10:04:34 2018 +0200 Test commit b0be065eadd0f2dd70f6613c50cbf3eb16d693ec Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 09:19:57 2018 +0200 test_client edit commit 949205ccdbac75f730639e5f0d8e1bdd9436de1d Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 05:14:53 2018 +0200 Edit Test commit 7cd44ee379a1e847f3e7d225444e72775bdbd4b5 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 04:25:22 2018 +0200 Updates commit e90de71e698d29475e8ba5696664b7d7bb335f9c Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 13:53:15 2018 +0200 Test commit 12a76381561b66ecf6ea636d7eebe43d2dcb7731 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 11:43:39 2018 +0200 Edited Tests commit 6c21e6de2da24e7b9f33ac8b82abb0b39488bd60 Merge: 87c4c74b8 9550cf766 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 87c4c74b8f769c8e4b55ba78b5aa1d6716413f6d Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:13 2018 +0200 Avoided Changing non-RPC Types commit 9550cf76610953c8492cc9473e4b9f876e770b70 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:29:03 2018 +0200 Update traces.rs commit 3e0b0ef29685b62f0917b80a48054b3379d59a50 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:27:44 2018 +0200 Update trace.rs commit 5078d67a2da7268db2a1064540a3c887e1f1a3cd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:26:08 2018 +0200 Update traces.rs commit 28f5ba1b035c6919ac11089cf1bdd703c75f0dbd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:24:04 2018 +0200 Update parity.rs commit 3b86b98ab5860efa61a7cc6a2b20e6c5c0f859cb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:23:33 2018 +0200 Update eth.rs commit bcad5a40f14a3c5d2d901ae1a9bed87949ab9c66 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:21:43 2018 +0200 Update call_analytics.rs commit e9029e0b8158387b606132b264652d285483870f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:56 2018 +0200 Update transaction.rs commit 0dacc81779bc62713e3f8e405229dfd7f89f33e8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:01 2018 +0200 Update executive.rs commit 3921d4ec77f49460d45603111b98cc07d3c235a0 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:18:39 2018 +0200 Update executed.rs commit 8416df654ebf6f68ad04c8a4a89a29ce704f9ca1 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:17:34 2018 +0200 Update client.rs commit cf0b4dddbc93395bc5ce1f17c3c07a294bf8dd49 Merge: 23bfa78c2 36e05e5f3 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:54:04 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 23bfa78c2662d697018e7061ab9ad0b864fde0ef Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:53:50 2018 +0200 Undo commit 36e05e5f30c35bd6b57af50fd337f2006df51b86 Merge: 2f6e1ef64 0afc74825 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:33 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 2f6e1ef64763a79ad2ed8baa2aed5a8f3136bafc Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:22 2018 +0200 Another rpc test output with ("transactionHash":null) commit 0afc74825828f724d68f3e444655b872a6c51ce0 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 07:18:45 2018 +0200 Another rpc test output with ("transactionHash":null) commit 138fbac9f02841adfeaaf061c5dd9e647f725e12 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 06:30:41 2018 +0200 Edited some rpc tests output with ("transactionHash":null) commit 8c129a63109c00f88ce36bad10699dc2f3237d95 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:48:39 2018 +0200 Update traces.rs commit 52c17f6191740637c1d1589a420996dccefe16bb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:47:29 2018 +0200 Update parity.rs commit d39303aa8c2097ba9e2ed94c7ad2166bf1608d3f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:46:25 2018 +0200 Update eth.rs commit 49be84bf529c33dc47c8260435fd0d26e137c66d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:40:56 2018 +0200 Update trace.rs commit 4fc801377fb01ff11867f66b547a307c162d7a56 Merge: d34ba2351 544210439 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 05:12:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 54421043959e14a76f309fe87d3c7513a95999f8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:04:51 2018 +0200 Update trace.rs commit 2b2524a31119d741df4076e9d1b3ce8f0b17b479 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:01:47 2018 +0200 Update state_diff.rs commit 2bf9982b8ce29ef69f116142eaeacf3049f7db49 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:50 2018 +0200 Update transaction.rs commit da696ea192c0f89cceb38834f6efee280129048c Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:13 2018 +0200 Update mod.rs commit cfc194ca0f44bfabec01a52897a322ea5a91930b Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:59:18 2018 +0200 Update pod_state.rs commit 3b3156853535a666778e0ad0e902de79fb138f1d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:57:37 2018 +0200 Update client.rs commit d34ba235132c654da6c2ed6ff0dcf96fda0c45ee Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 04:53:50 2018 +0200 RPC Only commit 8b5c4f19727549ee6f180a6effc228b2693509e9 Merge: 744491632 291b4a01b Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:55:14 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 74449163222e0ab75c704ac0ad424870e3c321d9 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:27:13 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 commit 291b4a01be6771acff8f5829c5406fa193665dbe Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 01:18:18 2018 +0200 Edited to make changes to RPC types only To make a transactions hash trace with "trace_replayBlockTransactions" add "transactionHash" to parameters commit 9d082bece73beb8ebddfda51fa5ec279f30b7bea Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 13 09:15:56 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 * update * Removed unwrap_or * Update * test_client update
2018-07-10 16:38:13 +02:00
/// A diff of some chunk of memory.
pub struct TraceResultsWithTransactionHash {
/// The output of the call/create
pub output: Bytes,
/// The transaction trace.
pub trace: Vec<Trace>,
/// The transaction trace.
pub vm_trace: Option<VMTrace>,
/// The transaction trace.
pub state_diff: Option<StateDiff>,
/// The transaction Hash.
pub transaction_hash: H256,
}
impl From<(H256, Executed)> for TraceResultsWithTransactionHash {
fn from(t: (H256, Executed)) -> Self {
Transactions hashes missing in trace_replayBlockTransactions method result #8725 (#8883) * Squashed commit of the following: commit 1f85076fd584365f1acbbafef5c8bdee722b479b Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:40:12 2018 +0200 update commit 63363cca7354873a8abe3b631b8b7dbd9da6ce1e Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:36:25 2018 +0200 Update commit e05caddc170a4cf0e476c23d443f07184dcb4fb1 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 10:04:34 2018 +0200 Test commit b0be065eadd0f2dd70f6613c50cbf3eb16d693ec Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 09:19:57 2018 +0200 test_client edit commit 949205ccdbac75f730639e5f0d8e1bdd9436de1d Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 05:14:53 2018 +0200 Edit Test commit 7cd44ee379a1e847f3e7d225444e72775bdbd4b5 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 04:25:22 2018 +0200 Updates commit e90de71e698d29475e8ba5696664b7d7bb335f9c Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 13:53:15 2018 +0200 Test commit 12a76381561b66ecf6ea636d7eebe43d2dcb7731 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 11:43:39 2018 +0200 Edited Tests commit 6c21e6de2da24e7b9f33ac8b82abb0b39488bd60 Merge: 87c4c74b8 9550cf766 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 87c4c74b8f769c8e4b55ba78b5aa1d6716413f6d Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:13 2018 +0200 Avoided Changing non-RPC Types commit 9550cf76610953c8492cc9473e4b9f876e770b70 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:29:03 2018 +0200 Update traces.rs commit 3e0b0ef29685b62f0917b80a48054b3379d59a50 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:27:44 2018 +0200 Update trace.rs commit 5078d67a2da7268db2a1064540a3c887e1f1a3cd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:26:08 2018 +0200 Update traces.rs commit 28f5ba1b035c6919ac11089cf1bdd703c75f0dbd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:24:04 2018 +0200 Update parity.rs commit 3b86b98ab5860efa61a7cc6a2b20e6c5c0f859cb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:23:33 2018 +0200 Update eth.rs commit bcad5a40f14a3c5d2d901ae1a9bed87949ab9c66 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:21:43 2018 +0200 Update call_analytics.rs commit e9029e0b8158387b606132b264652d285483870f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:56 2018 +0200 Update transaction.rs commit 0dacc81779bc62713e3f8e405229dfd7f89f33e8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:01 2018 +0200 Update executive.rs commit 3921d4ec77f49460d45603111b98cc07d3c235a0 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:18:39 2018 +0200 Update executed.rs commit 8416df654ebf6f68ad04c8a4a89a29ce704f9ca1 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:17:34 2018 +0200 Update client.rs commit cf0b4dddbc93395bc5ce1f17c3c07a294bf8dd49 Merge: 23bfa78c2 36e05e5f3 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:54:04 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 23bfa78c2662d697018e7061ab9ad0b864fde0ef Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:53:50 2018 +0200 Undo commit 36e05e5f30c35bd6b57af50fd337f2006df51b86 Merge: 2f6e1ef64 0afc74825 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:33 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 2f6e1ef64763a79ad2ed8baa2aed5a8f3136bafc Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:22 2018 +0200 Another rpc test output with ("transactionHash":null) commit 0afc74825828f724d68f3e444655b872a6c51ce0 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 07:18:45 2018 +0200 Another rpc test output with ("transactionHash":null) commit 138fbac9f02841adfeaaf061c5dd9e647f725e12 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 06:30:41 2018 +0200 Edited some rpc tests output with ("transactionHash":null) commit 8c129a63109c00f88ce36bad10699dc2f3237d95 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:48:39 2018 +0200 Update traces.rs commit 52c17f6191740637c1d1589a420996dccefe16bb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:47:29 2018 +0200 Update parity.rs commit d39303aa8c2097ba9e2ed94c7ad2166bf1608d3f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:46:25 2018 +0200 Update eth.rs commit 49be84bf529c33dc47c8260435fd0d26e137c66d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:40:56 2018 +0200 Update trace.rs commit 4fc801377fb01ff11867f66b547a307c162d7a56 Merge: d34ba2351 544210439 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 05:12:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 54421043959e14a76f309fe87d3c7513a95999f8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:04:51 2018 +0200 Update trace.rs commit 2b2524a31119d741df4076e9d1b3ce8f0b17b479 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:01:47 2018 +0200 Update state_diff.rs commit 2bf9982b8ce29ef69f116142eaeacf3049f7db49 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:50 2018 +0200 Update transaction.rs commit da696ea192c0f89cceb38834f6efee280129048c Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:13 2018 +0200 Update mod.rs commit cfc194ca0f44bfabec01a52897a322ea5a91930b Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:59:18 2018 +0200 Update pod_state.rs commit 3b3156853535a666778e0ad0e902de79fb138f1d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:57:37 2018 +0200 Update client.rs commit d34ba235132c654da6c2ed6ff0dcf96fda0c45ee Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 04:53:50 2018 +0200 RPC Only commit 8b5c4f19727549ee6f180a6effc228b2693509e9 Merge: 744491632 291b4a01b Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:55:14 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 74449163222e0ab75c704ac0ad424870e3c321d9 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:27:13 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 commit 291b4a01be6771acff8f5829c5406fa193665dbe Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 01:18:18 2018 +0200 Edited to make changes to RPC types only To make a transactions hash trace with "trace_replayBlockTransactions" add "transactionHash" to parameters commit 9d082bece73beb8ebddfda51fa5ec279f30b7bea Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 13 09:15:56 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 * update * Removed unwrap_or * Update * test_client update
2018-07-10 16:38:13 +02:00
TraceResultsWithTransactionHash {
output: t.1.output.into(),
trace: t.1.trace.into_iter().map(Into::into).collect(),
vm_trace: t.1.vm_trace.map(Into::into),
state_diff: t.1.state_diff.map(Into::into),
transaction_hash: t.0,
Transactions hashes missing in trace_replayBlockTransactions method result #8725 (#8883) * Squashed commit of the following: commit 1f85076fd584365f1acbbafef5c8bdee722b479b Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:40:12 2018 +0200 update commit 63363cca7354873a8abe3b631b8b7dbd9da6ce1e Author: shamardy <shamardy@yahoo.com> Date: Sat Jun 30 03:36:25 2018 +0200 Update commit e05caddc170a4cf0e476c23d443f07184dcb4fb1 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 10:04:34 2018 +0200 Test commit b0be065eadd0f2dd70f6613c50cbf3eb16d693ec Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 09:19:57 2018 +0200 test_client edit commit 949205ccdbac75f730639e5f0d8e1bdd9436de1d Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 05:14:53 2018 +0200 Edit Test commit 7cd44ee379a1e847f3e7d225444e72775bdbd4b5 Author: shamardy <shamardy@yahoo.com> Date: Fri Jun 29 04:25:22 2018 +0200 Updates commit e90de71e698d29475e8ba5696664b7d7bb335f9c Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 13:53:15 2018 +0200 Test commit 12a76381561b66ecf6ea636d7eebe43d2dcb7731 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 11:43:39 2018 +0200 Edited Tests commit 6c21e6de2da24e7b9f33ac8b82abb0b39488bd60 Merge: 87c4c74b8 9550cf766 Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 87c4c74b8f769c8e4b55ba78b5aa1d6716413f6d Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 27 10:31:13 2018 +0200 Avoided Changing non-RPC Types commit 9550cf76610953c8492cc9473e4b9f876e770b70 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:29:03 2018 +0200 Update traces.rs commit 3e0b0ef29685b62f0917b80a48054b3379d59a50 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:27:44 2018 +0200 Update trace.rs commit 5078d67a2da7268db2a1064540a3c887e1f1a3cd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:26:08 2018 +0200 Update traces.rs commit 28f5ba1b035c6919ac11089cf1bdd703c75f0dbd Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:24:04 2018 +0200 Update parity.rs commit 3b86b98ab5860efa61a7cc6a2b20e6c5c0f859cb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:23:33 2018 +0200 Update eth.rs commit bcad5a40f14a3c5d2d901ae1a9bed87949ab9c66 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:21:43 2018 +0200 Update call_analytics.rs commit e9029e0b8158387b606132b264652d285483870f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:56 2018 +0200 Update transaction.rs commit 0dacc81779bc62713e3f8e405229dfd7f89f33e8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:20:01 2018 +0200 Update executive.rs commit 3921d4ec77f49460d45603111b98cc07d3c235a0 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:18:39 2018 +0200 Update executed.rs commit 8416df654ebf6f68ad04c8a4a89a29ce704f9ca1 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Wed Jun 27 10:17:34 2018 +0200 Update client.rs commit cf0b4dddbc93395bc5ce1f17c3c07a294bf8dd49 Merge: 23bfa78c2 36e05e5f3 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:54:04 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 23bfa78c2662d697018e7061ab9ad0b864fde0ef Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:53:50 2018 +0200 Undo commit 36e05e5f30c35bd6b57af50fd337f2006df51b86 Merge: 2f6e1ef64 0afc74825 Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:33 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 2f6e1ef64763a79ad2ed8baa2aed5a8f3136bafc Author: shamardy <shamardy@yahoo.com> Date: Sun Jun 24 04:44:22 2018 +0200 Another rpc test output with ("transactionHash":null) commit 0afc74825828f724d68f3e444655b872a6c51ce0 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 07:18:45 2018 +0200 Another rpc test output with ("transactionHash":null) commit 138fbac9f02841adfeaaf061c5dd9e647f725e12 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 06:30:41 2018 +0200 Edited some rpc tests output with ("transactionHash":null) commit 8c129a63109c00f88ce36bad10699dc2f3237d95 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:48:39 2018 +0200 Update traces.rs commit 52c17f6191740637c1d1589a420996dccefe16bb Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:47:29 2018 +0200 Update parity.rs commit d39303aa8c2097ba9e2ed94c7ad2166bf1608d3f Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:46:25 2018 +0200 Update eth.rs commit 49be84bf529c33dc47c8260435fd0d26e137c66d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:40:56 2018 +0200 Update trace.rs commit 4fc801377fb01ff11867f66b547a307c162d7a56 Merge: d34ba2351 544210439 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 05:12:21 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 54421043959e14a76f309fe87d3c7513a95999f8 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:04:51 2018 +0200 Update trace.rs commit 2b2524a31119d741df4076e9d1b3ce8f0b17b479 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:01:47 2018 +0200 Update state_diff.rs commit 2bf9982b8ce29ef69f116142eaeacf3049f7db49 Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:50 2018 +0200 Update transaction.rs commit da696ea192c0f89cceb38834f6efee280129048c Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 05:00:13 2018 +0200 Update mod.rs commit cfc194ca0f44bfabec01a52897a322ea5a91930b Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:59:18 2018 +0200 Update pod_state.rs commit 3b3156853535a666778e0ad0e902de79fb138f1d Author: shamardy <39480341+shamardy@users.noreply.github.com> Date: Thu Jun 14 04:57:37 2018 +0200 Update client.rs commit d34ba235132c654da6c2ed6ff0dcf96fda0c45ee Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 04:53:50 2018 +0200 RPC Only commit 8b5c4f19727549ee6f180a6effc228b2693509e9 Merge: 744491632 291b4a01b Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:55:14 2018 +0200 Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725 commit 74449163222e0ab75c704ac0ad424870e3c321d9 Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 02:27:13 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 commit 291b4a01be6771acff8f5829c5406fa193665dbe Author: shamardy <shamardy@yahoo.com> Date: Thu Jun 14 01:18:18 2018 +0200 Edited to make changes to RPC types only To make a transactions hash trace with "trace_replayBlockTransactions" add "transactionHash" to parameters commit 9d082bece73beb8ebddfda51fa5ec279f30b7bea Author: shamardy <shamardy@yahoo.com> Date: Wed Jun 13 09:15:56 2018 +0200 Issue#8725 Transactions hashes missing in trace_replayBlockTransactions method result #8725 * update * Removed unwrap_or * Update * test_client update
2018-07-10 16:38:13 +02:00
}
}
}
#[cfg(test)]
mod tests {
use serde_json;
2016-06-07 21:44:57 +02:00
use std::collections::BTreeMap;
use v1::types::Bytes;
use ethcore::trace::TraceError;
use super::*;
#[test]
fn should_serialize_trace_results() {
let r = TraceResults {
output: vec![0x60].into(),
trace: vec![],
vm_trace: None,
state_diff: None,
};
let serialized = serde_json::to_string(&r).unwrap();
assert_eq!(serialized, r#"{"output":"0x60","trace":[],"vmTrace":null,"stateDiff":null}"#);
}
#[test]
fn test_trace_call_serialize() {
2016-06-02 13:50:50 +02:00
let t = LocalizedTrace {
action: Action::Call(Call {
from: 4.into(),
to: 5.into(),
value: 6.into(),
gas: 7.into(),
input: Bytes::new(vec![0x12, 0x34]),
call_type: CallType::Call,
}),
result: Res::Call(CallResult {
gas_used: 8.into(),
output: vec![0x56, 0x78].into(),
}),
trace_address: vec![10],
subtraces: 1,
transaction_position: Some(11),
transaction_hash: Some(12.into()),
block_number: 13,
block_hash: 14.into(),
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"type":"call","action":{"from":"0x0000000000000000000000000000000000000004","to":"0x0000000000000000000000000000000000000005","value":"0x6","gas":"0x7","input":"0x1234","callType":"call"},"result":{"gasUsed":"0x8","output":"0x5678"},"traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
}
#[test]
fn test_trace_failed_call_serialize() {
let t = LocalizedTrace {
action: Action::Call(Call {
from: 4.into(),
to: 5.into(),
value: 6.into(),
gas: 7.into(),
input: Bytes::new(vec![0x12, 0x34]),
call_type: CallType::Call,
}),
result: Res::FailedCall(TraceError::OutOfGas),
trace_address: vec![10],
subtraces: 1,
transaction_position: Some(11),
transaction_hash: Some(12.into()),
block_number: 13,
block_hash: 14.into(),
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"type":"call","action":{"from":"0x0000000000000000000000000000000000000004","to":"0x0000000000000000000000000000000000000005","value":"0x6","gas":"0x7","input":"0x1234","callType":"call"},"error":"Out of gas","traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
}
#[test]
fn test_trace_create_serialize() {
let t = LocalizedTrace {
action: Action::Create(Create {
from: 4.into(),
value: 6.into(),
gas: 7.into(),
init: Bytes::new(vec![0x12, 0x34]),
}),
result: Res::Create(CreateResult {
gas_used: 8.into(),
code: vec![0x56, 0x78].into(),
address: 0xff.into(),
}),
trace_address: vec![10],
subtraces: 1,
transaction_position: Some(11),
transaction_hash: Some(12.into()),
block_number: 13,
block_hash: 14.into(),
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"type":"create","action":{"from":"0x0000000000000000000000000000000000000004","value":"0x6","gas":"0x7","init":"0x1234"},"result":{"gasUsed":"0x8","code":"0x5678","address":"0x00000000000000000000000000000000000000ff"},"traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
}
#[test]
fn test_trace_failed_create_serialize() {
let t = LocalizedTrace {
action: Action::Create(Create {
from: 4.into(),
value: 6.into(),
gas: 7.into(),
init: Bytes::new(vec![0x12, 0x34]),
}),
result: Res::FailedCreate(TraceError::OutOfGas),
trace_address: vec![10],
subtraces: 1,
transaction_position: Some(11),
transaction_hash: Some(12.into()),
block_number: 13,
block_hash: 14.into(),
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"type":"create","action":{"from":"0x0000000000000000000000000000000000000004","value":"0x6","gas":"0x7","init":"0x1234"},"error":"Out of gas","traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
}
#[test]
fn test_trace_suicide_serialize() {
let t = LocalizedTrace {
action: Action::Suicide(Suicide {
address: 4.into(),
refund_address: 6.into(),
balance: 7.into(),
}),
result: Res::None,
trace_address: vec![10],
subtraces: 1,
transaction_position: Some(11),
transaction_hash: Some(12.into()),
block_number: 13,
block_hash: 14.into(),
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"type":"suicide","action":{"address":"0x0000000000000000000000000000000000000004","refundAddress":"0x0000000000000000000000000000000000000006","balance":"0x7"},"result":null,"traceAddress":[10],"subtraces":1,"transactionPosition":11,"transactionHash":"0x000000000000000000000000000000000000000000000000000000000000000c","blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
2017-07-27 17:54:17 +02:00
}
#[test]
fn test_trace_reward_serialize() {
let t = LocalizedTrace {
action: Action::Reward(Reward {
2017-07-31 12:06:38 +02:00
author: 4.into(),
2017-07-27 17:54:17 +02:00
value: 6.into(),
reward_type: RewardType::Block,
}),
result: Res::None,
trace_address: vec![10],
subtraces: 1,
transaction_position: None,
transaction_hash: None,
2017-07-27 17:54:17 +02:00
block_number: 13,
block_hash: 14.into(),
};
let serialized = serde_json::to_string(&t).unwrap();
2017-07-31 12:06:38 +02:00
assert_eq!(serialized, r#"{"type":"reward","action":{"author":"0x0000000000000000000000000000000000000004","value":"0x6","rewardType":"block"},"result":null,"traceAddress":[10],"subtraces":1,"transactionPosition":null,"transactionHash":null,"blockNumber":13,"blockHash":"0x000000000000000000000000000000000000000000000000000000000000000e"}"#);
}
2016-06-07 21:30:44 +02:00
#[test]
fn test_vmtrace_serialize() {
let t = VMTrace {
code: vec![0, 1, 2, 3].into(),
2016-06-07 21:30:44 +02:00
ops: vec![
VMOperation {
pc: 0,
cost: 10,
ex: None,
sub: None,
},
VMOperation {
pc: 1,
cost: 11,
ex: Some(VMExecutedOperation {
used: 10,
push: vec![69.into()],
mem: None,
store: None,
}),
sub: Some(VMTrace {
code: vec![0].into(),
2016-06-07 21:30:44 +02:00
ops: vec![
VMOperation {
pc: 0,
cost: 0,
ex: Some(VMExecutedOperation {
used: 10,
push: vec![42.into()].into(),
mem: Some(MemoryDiff {off: 42, data: vec![1, 2, 3].into()}),
2016-06-07 21:30:44 +02:00
store: Some(StorageDiff {key: 69.into(), val: 42.into()}),
}),
sub: None,
}
]
}),
}
]
};
let serialized = serde_json::to_string(&t).unwrap();
assert_eq!(serialized, r#"{"code":"0x00010203","ops":[{"pc":0,"cost":10,"ex":null,"sub":null},{"pc":1,"cost":11,"ex":{"used":10,"push":["0x45"],"mem":null,"store":null},"sub":{"code":"0x00","ops":[{"pc":0,"cost":0,"ex":{"used":10,"push":["0x2a"],"mem":{"off":42,"data":"0x010203"},"store":{"key":"0x45","val":"0x2a"}},"sub":null}]}}]}"#);
2016-06-07 21:30:44 +02:00
}
2016-06-07 21:44:57 +02:00
#[test]
fn test_statediff_serialize() {
let t = StateDiff(map![
42.into() => AccountDiff {
balance: Diff::Same,
nonce: Diff::Born(1.into()),
code: Diff::Same,
storage: map![
42.into() => Diff::Same
]
},
69.into() => AccountDiff {
balance: Diff::Same,
nonce: Diff::Changed(ChangedType { from: 1.into(), to: 0.into() }),
code: Diff::Died(vec![96].into()),
storage: map![],
}
]);
let serialized = serde_json::to_string(&t).unwrap();
2016-09-02 11:38:16 +02:00
assert_eq!(serialized, r#"{"0x000000000000000000000000000000000000002a":{"balance":"=","nonce":{"+":"0x1"},"code":"=","storage":{"0x000000000000000000000000000000000000000000000000000000000000002a":"="}},"0x0000000000000000000000000000000000000045":{"balance":"=","nonce":{"*":{"from":"0x1","to":"0x0"}},"code":{"-":"0x60"},"storage":{}}}"#);
2016-06-07 21:44:57 +02:00
}
}