Skip to content

Commit

Permalink
chore(blockifier): reduce boilerplate with derive_more::From
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <dori@starkware.co>
  • Loading branch information
dorimedini-starkware committed Nov 3, 2024
1 parent 1cb94ce commit 2862810
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions crates/blockifier/src/execution/stack_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ impl From<&VmExceptionFrame> for String {
}

#[cfg_attr(feature = "transaction_serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(derive_more::From)]
pub enum Frame {
EntryPoint(EntryPointErrorFrame),
Vm(VmExceptionFrame),
Expand All @@ -112,24 +113,6 @@ impl From<&Frame> for String {
}
}

impl From<EntryPointErrorFrame> for Frame {
fn from(value: EntryPointErrorFrame) -> Self {
Frame::EntryPoint(value)
}
}

impl From<VmExceptionFrame> for Frame {
fn from(value: VmExceptionFrame) -> Self {
Frame::Vm(value)
}
}

impl From<String> for Frame {
fn from(value: String) -> Self {
Frame::StringFrame(value)
}
}

#[cfg_attr(feature = "transaction_serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Default)]
pub struct ErrorStack {
Expand Down

0 comments on commit 2862810

Please sign in to comment.