From 370fcbae50895a35a895a9fcdf20b24084cd3150 Mon Sep 17 00:00:00 2001 From: Leonardo Yvens Date: Fri, 2 Feb 2024 15:09:22 +0000 Subject: [PATCH] fix rebase artifacts --- chain/starknet/src/data_source.rs | 2 +- chain/starknet/src/trigger.rs | 1 - runtime/wasm/src/host.rs | 2 +- runtime/wasm/src/host_exports.rs | 7 ++++--- runtime/wasm/src/mapping.rs | 2 +- runtime/wasm/src/module/context.rs | 1 + store/postgres/src/relational.rs | 6 +++--- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/chain/starknet/src/data_source.rs b/chain/starknet/src/data_source.rs index b9abe2dfedc..ef8ccd3ad9b 100644 --- a/chain/starknet/src/data_source.rs +++ b/chain/starknet/src/data_source.rs @@ -5,7 +5,7 @@ use graph::{ link_resolver::LinkResolver, store::StoredDynamicDataSource, subgraph::InstanceDSTemplateInfo, }, - data::subgraph::DataSourceContext, + data::subgraph::{DataSourceContext, SubgraphManifestValidationError}, prelude::{async_trait, BlockNumber, Deserialize, Link, Logger}, semver, }; diff --git a/chain/starknet/src/trigger.rs b/chain/starknet/src/trigger.rs index f14bdbba5b6..690c4c5c719 100644 --- a/chain/starknet/src/trigger.rs +++ b/chain/starknet/src/trigger.rs @@ -3,7 +3,6 @@ use graph::{ runtime::{asc_new, gas::GasCounter, AscPtr, HostExportError}, }; use graph_runtime_wasm::module::ToAscPtr; -use starknet_ff::FieldElement; use std::{cmp::Ordering, sync::Arc}; use crate::codec; diff --git a/runtime/wasm/src/host.rs b/runtime/wasm/src/host.rs index 70b564bf31c..661e3a65cec 100644 --- a/runtime/wasm/src/host.rs +++ b/runtime/wasm/src/host.rs @@ -5,7 +5,7 @@ use async_trait::async_trait; use futures::sync::mpsc::Sender; use futures03::channel::oneshot::channel; -use graph::blockchain::{Blockchain, HostFn, RuntimeAdapter}; +use graph::blockchain::{BlockTime, Blockchain, HostFn, RuntimeAdapter}; use graph::components::store::{EnsLookup, SubgraphFork}; use graph::components::subgraph::{MappingError, SharedProofOfIndexing}; use graph::data_source::{ diff --git a/runtime/wasm/src/host_exports.rs b/runtime/wasm/src/host_exports.rs index 30a52050e19..94af57e6b45 100644 --- a/runtime/wasm/src/host_exports.rs +++ b/runtime/wasm/src/host_exports.rs @@ -11,6 +11,7 @@ use never::Never; use semver::Version; use web3::types::H160; +use graph::blockchain::BlockTime; use graph::blockchain::Blockchain; use graph::components::store::{EnsLookup, GetScope, LoadRelatedRequest}; use graph::components::subgraph::{ @@ -351,7 +352,7 @@ impl HostExports { let entity_type = state.entity_cache.schema.entity_type(&entity_type)?; Self::expect_object_type(&entity_type, "remove")?; - let key = entity_type.parse_key_in(entity_id, self.data_source_causality_region)?; + let key = entity_type.parse_key_in(entity_id, self.data_source.causality_region)?; self.check_entity_type_access(&key.entity_type)?; gas.consume_host_fn_with_metrics( @@ -375,7 +376,7 @@ impl HostExports { let entity_type = state.entity_cache.schema.entity_type(&entity_type)?; Self::expect_object_type(&entity_type, "get")?; - let store_key = entity_type.parse_key_in(entity_id, self.data_source_causality_region)?; + let store_key = entity_type.parse_key_in(entity_id, self.data_source.causality_region)?; self.check_entity_type_access(&store_key.entity_type)?; let result = state.entity_cache.get(&store_key, scope)?; @@ -1113,7 +1114,7 @@ pub mod test_support { use std::{collections::HashMap, sync::Arc}; use graph::{ - blockchain::{BlockTime, Blockchain}, + blockchain::BlockTime, components::{ store::{BlockNumber, GetScope}, subgraph::SharedProofOfIndexing, diff --git a/runtime/wasm/src/mapping.rs b/runtime/wasm/src/mapping.rs index 38659f3e709..45cd79d6852 100644 --- a/runtime/wasm/src/mapping.rs +++ b/runtime/wasm/src/mapping.rs @@ -2,7 +2,7 @@ use crate::gas_rules::GasRules; use crate::module::{ExperimentalFeatures, ToAscPtr, WasmInstance}; use futures::sync::mpsc; use futures03::channel::oneshot::Sender; -use graph::blockchain::{Blockchain, HostFn}; +use graph::blockchain::{BlockTime, Blockchain, HostFn}; use graph::components::store::SubgraphFork; use graph::components::subgraph::{MappingError, SharedProofOfIndexing}; use graph::data_source::{MappingTrigger, TriggerWithHandler}; diff --git a/runtime/wasm/src/module/context.rs b/runtime/wasm/src/module/context.rs index 058e742cd2c..079deef8d88 100644 --- a/runtime/wasm/src/module/context.rs +++ b/runtime/wasm/src/module/context.rs @@ -269,6 +269,7 @@ impl WasmInstanceContext<'_> { block_number, &mut ctx.state, &ctx.proof_of_indexing, + ctx.timestamp, entity, id, data, diff --git a/store/postgres/src/relational.rs b/store/postgres/src/relational.rs index 9249edaa6b5..7c037790c67 100644 --- a/store/postgres/src/relational.rs +++ b/store/postgres/src/relational.rs @@ -362,9 +362,9 @@ impl Layout { qualified_name: SqlName::qualified_name(&catalog.site.namespace, &table_name), name: table_name, columns, - /// The position of this table in all the tables for this layout; this - /// is really only needed for the tests to make the names of indexes - /// predictable + // The position of this table in all the tables for this layout; this + // is really only needed for the tests to make the names of indexes + // predictable position: position as u32, is_account_like: false, immutable: false,