Skip to content

Commit 432c571

Browse files
committed
use Certificate::from instead of try_from
1 parent b3b39e8 commit 432c571

File tree

1 file changed

+3
-5
lines changed
  • explorer/src/api/graphql

1 file changed

+3
-5
lines changed

explorer/src/api/graphql/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -877,11 +877,9 @@ impl Transaction {
877877
&self,
878878
context: &Context<'_>,
879879
) -> FieldResult<Option<certificates::Certificate>> {
880-
let transaction = self.get_contents(context).await?;
881-
match transaction.certificate {
882-
Some(c) => Certificate::try_from(c).map(Some).map_err(|e| e.into()),
883-
None => Ok(None),
884-
}
880+
self.get_contents(context)
881+
.await
882+
.map(|transaction| transaction.certificate.map(Certificate::from))
885883
}
886884
}
887885

0 commit comments

Comments
 (0)