chore: add convenient from impls (#2112)
This commit is contained in:
parent
56cc3e674a
commit
0bb6f51082
|
@ -70,6 +70,18 @@ pub enum GethTraceFrame {
|
||||||
CallTracer(CallFrame),
|
CallTracer(CallFrame),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<DefaultFrame> for GethTraceFrame {
|
||||||
|
fn from(value: DefaultFrame) -> Self {
|
||||||
|
GethTraceFrame::Default(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<CallFrame> for GethTraceFrame {
|
||||||
|
fn from(value: CallFrame) -> Self {
|
||||||
|
GethTraceFrame::CallTracer(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum GethTrace {
|
pub enum GethTrace {
|
||||||
|
@ -77,6 +89,18 @@ pub enum GethTrace {
|
||||||
Unknown(Value),
|
Unknown(Value),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<GethTraceFrame> for GethTrace {
|
||||||
|
fn from(value: GethTraceFrame) -> Self {
|
||||||
|
GethTrace::Known(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<Value> for GethTrace {
|
||||||
|
fn from(value: Value) -> Self {
|
||||||
|
GethTrace::Unknown(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Available built-in tracers
|
/// Available built-in tracers
|
||||||
///
|
///
|
||||||
/// See <https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers>
|
/// See <https://geth.ethereum.org/docs/developers/evm-tracing/built-in-tracers>
|
||||||
|
|
Loading…
Reference in New Issue