Skip to content

Commit 41b13a6

Browse files
committed
graph: Remove unused TryFromValue for BlockPtr
1 parent f4f00ee commit 41b13a6

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

graph/src/blockchain/types.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::data::graphql::IntoValue;
1717
use crate::data::store::scalar::Timestamp;
1818
use crate::derive::CheapClone;
1919
use crate::object;
20-
use crate::prelude::{r, BigInt, TryFromValue, Value, ValueMap};
20+
use crate::prelude::{r, Value};
2121
use crate::util::stable_hash_glue::{impl_stable_hash, AsBytes};
2222

2323
/// A simple marker for byte arrays that are really block hashes
@@ -302,23 +302,6 @@ impl TryFrom<(&[u8], i64)> for BlockPtr {
302302
}
303303
}
304304

305-
impl TryFromValue for BlockPtr {
306-
fn try_from_value(value: &r::Value) -> Result<Self, anyhow::Error> {
307-
match value {
308-
r::Value::Object(o) => {
309-
let number = o.get_required::<BigInt>("number")?.to_u64() as BlockNumber;
310-
let hash = o.get_required::<BlockHash>("hash")?;
311-
312-
Ok(BlockPtr::new(hash, number))
313-
}
314-
_ => Err(anyhow!(
315-
"failed to parse non-object value into BlockPtr: {:?}",
316-
value
317-
)),
318-
}
319-
}
320-
}
321-
322305
impl IntoValue for BlockPtr {
323306
fn into_value(self) -> r::Value {
324307
object! {

0 commit comments

Comments
 (0)