diff --git a/ethers-core/src/types/trace/geth.rs b/ethers-core/src/types/trace/geth.rs index ededdadb..6c4ca3ac 100644 --- a/ethers-core/src/types/trace/geth.rs +++ b/ethers-core/src/types/trace/geth.rs @@ -70,6 +70,18 @@ pub enum GethTraceFrame { CallTracer(CallFrame), } +impl From for GethTraceFrame { + fn from(value: DefaultFrame) -> Self { + GethTraceFrame::Default(value) + } +} + +impl From for GethTraceFrame { + fn from(value: CallFrame) -> Self { + GethTraceFrame::CallTracer(value) + } +} + #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] #[serde(untagged)] pub enum GethTrace { @@ -77,6 +89,18 @@ pub enum GethTrace { Unknown(Value), } +impl From for GethTrace { + fn from(value: GethTraceFrame) -> Self { + GethTrace::Known(value) + } +} + +impl From for GethTrace { + fn from(value: Value) -> Self { + GethTrace::Unknown(value) + } +} + /// Available built-in tracers /// /// See