diff --git a/tests/runner-tests/subgraph-data-sources/abis/Contract.abi b/tests/runner-tests/subgraph-data-sources/abis/Contract.abi deleted file mode 100644 index 9d9f56b9263..00000000000 --- a/tests/runner-tests/subgraph-data-sources/abis/Contract.abi +++ /dev/null @@ -1,15 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "testCommand", - "type": "string" - } - ], - "name": "TestEvent", - "type": "event" - } -] diff --git a/tests/runner-tests/subgraph-data-sources/package.json b/tests/runner-tests/subgraph-data-sources/package.json deleted file mode 100644 index 87537290ad2..00000000000 --- a/tests/runner-tests/subgraph-data-sources/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "subgraph-data-sources", - "version": "0.1.0", - "scripts": { - "codegen": "graph codegen --skip-migrations", - "create:test": "graph create test/subgraph-data-sources --node $GRAPH_NODE_ADMIN_URI", - "deploy:test": "graph deploy test/subgraph-data-sources --version-label v0.0.1 --ipfs $IPFS_URI --node $GRAPH_NODE_ADMIN_URI" - }, - "devDependencies": { - "@graphprotocol/graph-cli": "0.79.0-alpha-20240711124603-49edf22", - "@graphprotocol/graph-ts": "0.31.0" - } -} diff --git a/tests/runner-tests/subgraph-data-sources/schema.graphql b/tests/runner-tests/subgraph-data-sources/schema.graphql deleted file mode 100644 index 6f97fa65c43..00000000000 --- a/tests/runner-tests/subgraph-data-sources/schema.graphql +++ /dev/null @@ -1,6 +0,0 @@ -type Data @entity { - id: ID! - foo: String - bar: Int - isTest: Boolean -} diff --git a/tests/runner-tests/subgraph-data-sources/src/mapping.ts b/tests/runner-tests/subgraph-data-sources/src/mapping.ts deleted file mode 100644 index cd5c1d4dcd1..00000000000 --- a/tests/runner-tests/subgraph-data-sources/src/mapping.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Entity, log } from '@graphprotocol/graph-ts'; - -export const SubgraphEntityOpCreate: u32 = 0; -export const SubgraphEntityOpModify: u32 = 1; -export const SubgraphEntityOpDelete: u32 = 2; - -export class EntityTrigger { - constructor( - public entityOp: u32, - public entityType: string, - public entity: Entity, - public vid: i64, - ) {} -} - -export function handleBlock(content: EntityTrigger): void { - let stringContent = content.entity.getString('val'); - log.info('Content: {}', [stringContent]); - log.info('EntityOp: {}', [content.entityOp.toString()]); - - switch (content.entityOp) { - case SubgraphEntityOpCreate: { - log.info('Entity created: {}', [content.entityType]); - break - } - case SubgraphEntityOpModify: { - log.info('Entity modified: {}', [content.entityType]); - break; - } - case SubgraphEntityOpDelete: { - log.info('Entity deleted: {}', [content.entityType]); - break; - } - } -} diff --git a/tests/runner-tests/subgraph-data-sources/subgraph.yaml b/tests/runner-tests/subgraph-data-sources/subgraph.yaml deleted file mode 100644 index 01f719d069f..00000000000 --- a/tests/runner-tests/subgraph-data-sources/subgraph.yaml +++ /dev/null @@ -1,19 +0,0 @@ -specVersion: 1.3.0 -schema: - file: ./schema.graphql -dataSources: - - kind: subgraph - name: Contract - network: test - source: - address: 'QmRFXhvyvbm4z5Lo7z2mN9Ckmo623uuB2jJYbRmAXgYKXJ' - startBlock: 0 - mapping: - apiVersion: 0.0.7 - language: wasm/assemblyscript - entities: - - Gravatar - handlers: - - handler: handleBlock - entity: User - file: ./src/mapping.ts diff --git a/tests/tests/runner_tests.rs b/tests/tests/runner_tests.rs index a6eb3200829..f67f0f2afa2 100644 --- a/tests/tests/runner_tests.rs +++ b/tests/tests/runner_tests.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use std::time::Duration; use assert_json_diff::assert_json_eq; -use graph::blockchain::block_stream::{BlockWithTriggers, EntityOperationKind}; +use graph::blockchain::block_stream::BlockWithTriggers; use graph::blockchain::{Block, BlockPtr, Blockchain}; use graph::data::store::scalar::Bytes; use graph::data::subgraph::schema::{SubgraphError, SubgraphHealth}; @@ -18,12 +18,11 @@ use graph::object; use graph::prelude::ethabi::ethereum_types::H256; use graph::prelude::web3::types::Address; use graph::prelude::{ - hex, CheapClone, DeploymentHash, SubgraphAssignmentProvider, SubgraphName, SubgraphStore, Value, + hex, CheapClone, DeploymentHash, SubgraphAssignmentProvider, SubgraphName, SubgraphStore, }; -use graph::schema::InputSchema; use graph_tests::fixture::ethereum::{ chain, empty_block, generate_empty_blocks_for_range, genesis, push_test_command, push_test_log, - push_test_polling_trigger, push_test_subgraph_trigger, + push_test_polling_trigger, }; use graph_tests::fixture::substreams::chain as substreams_chain; @@ -1091,54 +1090,6 @@ async fn parse_data_source_context() { ); } -#[tokio::test] -async fn subgraph_data_sources() { - let RunnerTestRecipe { stores, test_info } = - RunnerTestRecipe::new("subgraph-data-sources", "subgraph-data-sources").await; - - let schema = InputSchema::parse_latest( - "type User @entity { id: String!, val: String! }", - DeploymentHash::new("test").unwrap(), - ) - .unwrap(); - - let entity = schema - .make_entity(vec![ - ("id".into(), Value::String("id".to_owned())), - ("val".into(), Value::String("DATA".to_owned())), - ]) - .unwrap(); - - let entity_type = schema.entity_type("User").unwrap(); - - let blocks = { - let block_0 = genesis(); - let mut block_1 = empty_block(block_0.ptr(), test_ptr(1)); - - push_test_subgraph_trigger( - &mut block_1, - DeploymentHash::new("QmRFXhvyvbm4z5Lo7z2mN9Ckmo623uuB2jJYbRmAXgYKXJ").unwrap(), - entity, - entity_type, - EntityOperationKind::Create, - 1, - ); - - let block_2 = empty_block(block_1.ptr(), test_ptr(2)); - vec![block_0, block_1, block_2] - }; - let stop_block = blocks.last().unwrap().block.ptr(); - let chain = chain(&test_info.test_name, blocks, &stores, None).await; - - let ctx = fixture::setup(&test_info, &stores, &chain, None, None).await; - let _ = ctx - .runner(stop_block) - .await - .run_for_test(true) - .await - .unwrap(); -} - #[tokio::test] async fn retry_create_ds() { let RunnerTestRecipe { stores, test_info } =