Skip to content

Commit

Permalink
core: use existence check in graft_pending
Browse files Browse the repository at this point in the history
  • Loading branch information
incrypto32 committed Jun 20, 2023
1 parent 5062fe8 commit f999321
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/subgraph/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,12 @@ async fn create_subgraph_version<C: Blockchain, S: SubgraphStore>(
)
.map_err(SubgraphRegistrarError::ResolveError)
.await?;
let exists = store.is_deployed(&deployment)?;
let should_validate = !exists || store.graft_pending(&deployment)?;

let should_validate = match store.graft_pending(&deployment) {
Ok(graft_pending) => graft_pending,
Err(StoreError::DeploymentNotFound(_)) => true,
Err(e) => return Err(SubgraphRegistrarError::StoreError(e)),
};
let manifest = unvalidated
.validate(store.cheap_clone(), should_validate)
.await
Expand Down

0 comments on commit f999321

Please sign in to comment.