mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 01:28:21 -05:00
fix: rm outdated flatten (#3630)
This commit is contained in:
@@ -223,9 +223,8 @@ pub enum TraceOutput {
|
||||
pub struct TransactionTrace {
|
||||
#[serde(flatten)]
|
||||
pub action: Action,
|
||||
#[serde(flatten)]
|
||||
#[serde(flatten, skip_serializing_if = "Option::is_none")]
|
||||
pub error: Option<String>,
|
||||
#[serde(flatten)]
|
||||
pub result: Option<TraceOutput>,
|
||||
pub subtraces: usize,
|
||||
pub trace_address: Vec<usize>,
|
||||
@@ -303,3 +302,35 @@ pub struct StorageDelta {
|
||||
pub key: U256,
|
||||
pub val: U256,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_transaction_trace() {
|
||||
let s = r#"{
|
||||
"action": {
|
||||
"from": "0x66e29f0b6b1b07071f2fde4345d512386cb66f5f",
|
||||
"callType": "call",
|
||||
"gas": "0x10bfc",
|
||||
"input": "0xf6cd1e8d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000011c37937e080000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ec6952892271c8ee13f12e118484e03149281c9600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010480862479000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000160f5f00288e9e1cc8655b327e081566e580a71d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000011c37937e080000fffffffffffffffffffffffffffffffffffffffffffffffffee3c86c81f8000000000000000000000000000000000000000000000000000000000000",
|
||||
"to": "0x160f5f00288e9e1cc8655b327e081566e580a71d",
|
||||
"value": "0x244b"
|
||||
},
|
||||
"blockHash": "0xbca9ee244882bd00a19737a66f24002a4562a949c4d5ebd03c32e04111cff536",
|
||||
"blockNumber": 17600209,
|
||||
"error": "Reverted",
|
||||
"result": {
|
||||
"gasUsed": "0x9daf",
|
||||
"output": "0x000000000000000000000000000000000000000000000000011c37937e080000"
|
||||
},
|
||||
"subtraces": 3,
|
||||
"traceAddress": [],
|
||||
"transactionHash": "0x0e48a8d4419efaa2d3a9b8f625a1c559a4179fd19ddd10c02842965f3a7e7b63",
|
||||
"transactionPosition": 0,
|
||||
"type": "call"
|
||||
}"#;
|
||||
let _val = serde_json::from_str::<TransactionTrace>(s).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user