From 00c0e3aaa4b889b401fca89f94f1e5061ca732ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Fri, 2 Aug 2024 15:24:04 -0400 Subject: [PATCH] add substreams::skip_empty_output to all generated code, bump substreams-rs to 0.5.21 --- ethfull/templates/Cargo.toml.gotmpl | 2 +- ethfull/templates/entities/README.md | 10 ---------- ethfull/templates/src/lib.rs.gotmpl | 2 ++ ethfull/testoutput/bayc_triggers/README.md | 10 ---------- ethfull/testoutput/bayc_triggers/substreams/Cargo.toml | 2 +- ethfull/testoutput/bayc_triggers/substreams/src/lib.rs | 2 ++ ethfull/testoutput/complex_abi/Cargo.toml | 2 +- ethfull/testoutput/complex_abi/src/lib.rs | 2 ++ ethfull/testoutput/uniswap_factory_v3/README.md | 10 ---------- .../uniswap_factory_v3/substreams/Cargo.toml | 2 +- .../uniswap_factory_v3/substreams/src/lib.rs | 1 + .../substreams/Cargo.toml | 2 +- .../substreams/src/lib.rs | 2 ++ injective-events/templates/Cargo.toml.gotmpl | 2 +- injective-events/templates/lib.rs.gotmpl | 1 + starknet/templates/Cargo.toml.gotmpl | 2 +- starknet/templates/txfilter/lib.rs.gotmpl | 2 ++ 17 files changed, 19 insertions(+), 37 deletions(-) diff --git a/ethfull/templates/Cargo.toml.gotmpl b/ethfull/templates/Cargo.toml.gotmpl index ba18bf0..02931ed 100644 --- a/ethfull/templates/Cargo.toml.gotmpl +++ b/ethfull/templates/Cargo.toml.gotmpl @@ -14,7 +14,7 @@ num-bigint = "0.4" num-traits = "0.2.15" prost = "0.11" prost-types = "0.11" -substreams = "0.5" +substreams = "0.5.21" substreams-ethereum = "0.9" substreams-database-change = "1" substreams-entity-change = "1" diff --git a/ethfull/templates/entities/README.md b/ethfull/templates/entities/README.md index 39500e8..55f1b40 100644 --- a/ethfull/templates/entities/README.md +++ b/ethfull/templates/entities/README.md @@ -30,16 +30,6 @@ To run a local `graph-node` instance, you will need to install Docker. You can d To run the proto assembly script bindings, you will need to install the `buf` [cli](https://buf.build/docs/installation). -## Run the entire stack with the `run-local.sh` script - -You can run the entire stack (`docker`, `npm` installations and `graph` creation with deployment) by running the below script - -```bash -./run-local.sh -``` - -However, if you want to run each commen individually, follow the instructions below: - ## Install npm and nodeJS packages Run the following command in the `root` of the repository: diff --git a/ethfull/templates/src/lib.rs.gotmpl b/ethfull/templates/src/lib.rs.gotmpl index ceb06d5..c75d800 100644 --- a/ethfull/templates/src/lib.rs.gotmpl +++ b/ethfull/templates/src/lib.rs.gotmpl @@ -428,6 +428,7 @@ fn map_events(blk: eth::Block) -> Result Result { let mut events = contract::Events::default(); map_bayc_events(&blk, &mut events); + substreams::skip_empty_output(); Ok(events) } #[substreams::handlers::map] fn map_calls(blk: eth::Block) -> Result { let mut calls = contract::Calls::default(); map_bayc_calls(&blk, &mut calls); + substreams::skip_empty_output(); Ok(calls) } diff --git a/ethfull/testoutput/complex_abi/Cargo.toml b/ethfull/testoutput/complex_abi/Cargo.toml index e63a30e..f06375d 100644 --- a/ethfull/testoutput/complex_abi/Cargo.toml +++ b/ethfull/testoutput/complex_abi/Cargo.toml @@ -14,7 +14,7 @@ num-bigint = "0.4" num-traits = "0.2.15" prost = "0.11" prost-types = "0.11" -substreams = "0.5" +substreams = "0.5.21" substreams-ethereum = "0.9" substreams-database-change = "1" substreams-entity-change = "1" diff --git a/ethfull/testoutput/complex_abi/src/lib.rs b/ethfull/testoutput/complex_abi/src/lib.rs index d5ca4a8..7a54c35 100644 --- a/ethfull/testoutput/complex_abi/src/lib.rs +++ b/ethfull/testoutput/complex_abi/src/lib.rs @@ -1048,6 +1048,7 @@ fn map_events( let mut events = contract::Events::default(); map_ewqocontraadd123_events(&blk, &mut events); map_test_events(&blk, &store_test, &mut events); + substreams::skip_empty_output(); Ok(events) } #[substreams::handlers::map] @@ -1059,6 +1060,7 @@ fn map_calls( let mut calls = contract::Calls::default(); map_ewqocontraadd123_calls(&blk, &mut calls); map_test_calls(&blk, &store_test, &mut calls); + substreams::skip_empty_output(); Ok(calls) } #[substreams::handlers::map] diff --git a/ethfull/testoutput/uniswap_factory_v3/README.md b/ethfull/testoutput/uniswap_factory_v3/README.md index 39500e8..55f1b40 100644 --- a/ethfull/testoutput/uniswap_factory_v3/README.md +++ b/ethfull/testoutput/uniswap_factory_v3/README.md @@ -30,16 +30,6 @@ To run a local `graph-node` instance, you will need to install Docker. You can d To run the proto assembly script bindings, you will need to install the `buf` [cli](https://buf.build/docs/installation). -## Run the entire stack with the `run-local.sh` script - -You can run the entire stack (`docker`, `npm` installations and `graph` creation with deployment) by running the below script - -```bash -./run-local.sh -``` - -However, if you want to run each commen individually, follow the instructions below: - ## Install npm and nodeJS packages Run the following command in the `root` of the repository: diff --git a/ethfull/testoutput/uniswap_factory_v3/substreams/Cargo.toml b/ethfull/testoutput/uniswap_factory_v3/substreams/Cargo.toml index 11fe5fb..78cc69e 100644 --- a/ethfull/testoutput/uniswap_factory_v3/substreams/Cargo.toml +++ b/ethfull/testoutput/uniswap_factory_v3/substreams/Cargo.toml @@ -14,7 +14,7 @@ num-bigint = "0.4" num-traits = "0.2.15" prost = "0.11" prost-types = "0.11" -substreams = "0.5" +substreams = "0.5.21" substreams-ethereum = "0.9" substreams-database-change = "1" substreams-entity-change = "1" diff --git a/ethfull/testoutput/uniswap_factory_v3/substreams/src/lib.rs b/ethfull/testoutput/uniswap_factory_v3/substreams/src/lib.rs index 183b4cf..47b9058 100644 --- a/ethfull/testoutput/uniswap_factory_v3/substreams/src/lib.rs +++ b/ethfull/testoutput/uniswap_factory_v3/substreams/src/lib.rs @@ -87,6 +87,7 @@ fn map_unifactory_events(blk: ð::Block, events: &mut contract::Events) { fn map_events(blk: eth::Block) -> Result { let mut events = contract::Events::default(); map_unifactory_events(&blk, &mut events); + substreams::skip_empty_output(); Ok(events) } diff --git a/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/Cargo.toml b/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/Cargo.toml index 785528d..28224e2 100644 --- a/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/Cargo.toml +++ b/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/Cargo.toml @@ -14,7 +14,7 @@ num-bigint = "0.4" num-traits = "0.2.15" prost = "0.11" prost-types = "0.11" -substreams = "0.5" +substreams = "0.5.21" substreams-ethereum = "0.9" substreams-database-change = "1" substreams-entity-change = "1" diff --git a/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/src/lib.rs b/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/src/lib.rs index 77419e7..40ec4da 100644 --- a/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/src/lib.rs +++ b/ethfull/testoutput/uniswap_v3_triggers_dynamic_datasources/substreams/src/lib.rs @@ -712,6 +712,7 @@ fn map_events( let mut events = contract::Events::default(); map_factory_events(&blk, &mut events); map_pools_events(&blk, &store_pools, &mut events); + substreams::skip_empty_output(); Ok(events) } #[substreams::handlers::map] @@ -723,6 +724,7 @@ fn map_calls( let mut calls = contract::Calls::default(); map_factory_calls(&blk, &mut calls); map_pools_calls(&blk, &store_pools, &mut calls); + substreams::skip_empty_output(); Ok(calls) } diff --git a/injective-events/templates/Cargo.toml.gotmpl b/injective-events/templates/Cargo.toml.gotmpl index 89785ce..f71cfcc 100644 --- a/injective-events/templates/Cargo.toml.gotmpl +++ b/injective-events/templates/Cargo.toml.gotmpl @@ -14,7 +14,7 @@ strip = "debuginfo" crate-type = ["cdylib"] [dependencies] -substreams = "^0.5.19" +substreams = "0.5.21" substreams-database-change = "1" hex = "0.4.3" prost = "0.11" diff --git a/injective-events/templates/lib.rs.gotmpl b/injective-events/templates/lib.rs.gotmpl index 576a77a..ba914d8 100644 --- a/injective-events/templates/lib.rs.gotmpl +++ b/injective-events/templates/lib.rs.gotmpl @@ -10,6 +10,7 @@ fn db_out(events: EventList) -> Result Result