Query the contents of a CID from the IPLD store.
(&self, cid: &Cid, height: FvmQueryHeight)
| 42 | pub trait QueryClient: Sync { |
| 43 | /// Query the contents of a CID from the IPLD store. |
| 44 | async fn ipld(&self, cid: &Cid, height: FvmQueryHeight) -> anyhow::Result<Option<Vec<u8>>> { |
| 45 | let res = self |
| 46 | .perform(FvmQuery::Ipld(*cid), height) |
| 47 | .await |
| 48 | .context("ipld query failed")?; |
| 49 | extract_opt(res, |res| Ok(res.value)) |
| 50 | } |
| 51 | |
| 52 | /// Query the the state of an actor. |
| 53 | async fn actor_state( |