fuel-core 0.48.0

Fuel client library is aggregation of all fuels service. It contains the all business logic of the fuel protocol.
Documentation
use crate::fuel_core_graphql_api::database::ReadView;
use fuel_core_storage::{
    Result as StorageResult,
    StorageAsRef,
    not_found,
    tables::BlobData,
};
use fuel_core_types::fuel_tx::BlobId;

impl ReadView {
    pub fn blob_exists(&self, id: BlobId) -> StorageResult<bool> {
        self.storage::<BlobData>().contains_key(&id)
    }

    pub fn blob_bytecode(&self, id: BlobId) -> StorageResult<Vec<u8>> {
        let blob = self
            .storage::<BlobData>()
            .get(&id)?
            .ok_or(not_found!(BlobData))?
            .into_owned();

        Ok(blob.into())
    }
}