Skip to content

Commit

Permalink
feat(json-rpc): implement From U256 and String for SubId (#1226)
Browse files Browse the repository at this point in the history
feat(json-rpc): implement From U256 and String for SubId
  • Loading branch information
Evalir authored Sep 2, 2024
1 parent 91d323f commit 8d5f065
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/json-rpc/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ pub enum SubId {
String(String),
}

impl From<U256> for SubId {
fn from(value: U256) -> Self {
Self::Number(value)
}
}

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

/// An ethereum-style notification, not to be confused with a JSON-RPC
/// notification.
#[derive(Clone, Debug, Serialize, Deserialize)]
Expand Down

0 comments on commit 8d5f065

Please sign in to comment.