Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rpc): implement Default for TransactionTrace #816

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/rpc-types-trace/src/parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ pub enum Action {
Reward(RewardAction),
}

impl Default for Action {
fn default() -> Self {
Self::Call(CallAction::default())
}
}

impl Action {
/// Returns true if this is a call action
pub const fn is_call(&self) -> bool {
Expand Down Expand Up @@ -240,7 +246,7 @@ pub enum CallType {
}

/// Represents a certain [CallType] of a _call_ or message transaction.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CallAction {
/// Address of the sending account.
Expand Down Expand Up @@ -358,7 +364,7 @@ impl TraceOutput {
}

/// A parity style trace of a transaction.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TransactionTrace {
/// Represents what kind of trace this is
Expand Down
Loading