Skip to content

Commit

Permalink
graph: bump spec version to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
incrypto32 committed Jan 9, 2024
1 parent b002d3d commit 59e0685
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion graph/src/data/subgraph/api_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub const SPEC_VERSION_0_0_8: Version = Version::new(0, 0, 8);
pub const SPEC_VERSION_0_0_9: Version = Version::new(0, 0, 9);

// Enables `indexerHints` feature.
pub const SPEC_VERSION_0_1_0: Version = Version::new(0, 1, 0);
pub const SPEC_VERSION_1_0_0: Version = Version::new(1, 0, 0);

pub const MIN_SPEC_VERSION: Version = Version::new(0, 0, 2);

Expand Down
4 changes: 2 additions & 2 deletions graph/src/data/subgraph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -952,10 +952,10 @@ impl<C: Blockchain> UnresolvedSubgraphManifest<C> {
);
}

if spec_version < SPEC_VERSION_0_1_0 && indexer_hints.is_some() {
if spec_version < SPEC_VERSION_1_0_0 && indexer_hints.is_some() {
bail!(
"`indexerHints` are not supported prior to {}",
SPEC_VERSION_0_1_0
SPEC_VERSION_1_0_0
);
}

Expand Down
2 changes: 1 addition & 1 deletion graph/src/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ struct Inner {
default = "false"
)]
allow_non_deterministic_fulltext_search: EnvVarBoolean,
#[envconfig(from = "GRAPH_MAX_SPEC_VERSION", default = "0.0.9")]
#[envconfig(from = "GRAPH_MAX_SPEC_VERSION", default = "1.0.0")]
max_spec_version: Version,
#[envconfig(from = "GRAPH_LOAD_WINDOW_SIZE", default = "300")]
load_window_size_in_secs: u64,
Expand Down
9 changes: 4 additions & 5 deletions store/test-store/tests/chain/ethereum/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use graph::data::store::scalar::Bytes;
use graph::data::store::Value;
use graph::data::subgraph::schema::SubgraphError;
use graph::data::subgraph::{
HistoryBlocks, SPEC_VERSION_0_0_4, SPEC_VERSION_0_0_7, SPEC_VERSION_0_0_8, SPEC_VERSION_0_0_9,
SPEC_VERSION_0_1_0,
HistoryBlocks, SPEC_VERSION_0_0_4, SPEC_VERSION_0_0_7, SPEC_VERSION_0_0_8, SPEC_VERSION_0_0_9, SPEC_VERSION_1_0_0,
};
use graph::data_source::offchain::OffchainDataSourceKind;
use graph::data_source::DataSourceTemplate;
Expand Down Expand Up @@ -203,7 +202,7 @@ indexerHints:
historyBlocks: 100
";

let manifest = resolve_manifest(YAML, SPEC_VERSION_0_1_0).await;
let manifest = resolve_manifest(YAML, SPEC_VERSION_1_0_0).await;

assert_eq!(manifest.history_blocks(), 100);

Expand All @@ -220,7 +219,7 @@ indexerHints:
historyBlocks: min
";

let manifest = resolve_manifest(yaml, SPEC_VERSION_0_1_0).await;
let manifest = resolve_manifest(yaml, SPEC_VERSION_1_0_0).await;
HistoryBlocks::Min.history_blocks();
assert_eq!(
manifest.history_blocks(),
Expand All @@ -240,7 +239,7 @@ indexerHints:
historyBlocks: all
";

let manifest = resolve_manifest(yaml, SPEC_VERSION_0_1_0).await;
let manifest = resolve_manifest(yaml, SPEC_VERSION_1_0_0).await;

assert_eq!(
manifest.history_blocks(),
Expand Down

0 comments on commit 59e0685

Please sign in to comment.