Skip to content

Commit

Permalink
add substreams::skip_empty_output to all generated code, bump substre…
Browse files Browse the repository at this point in the history
…ams-rs to 0.5.21
  • Loading branch information
sduchesneau committed Aug 2, 2024
1 parent a1f5ef0 commit 00c0e3a
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 37 deletions.
2 changes: 1 addition & 1 deletion ethfull/templates/Cargo.toml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 0 additions & 10 deletions ethfull/templates/entities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions ethfull/templates/src/lib.rs.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ fn map_events(blk: eth::Block) -> Result<contract::Events, substreams::errors::E
map_{{ $ddsContract.Identifier }}_events(&blk, &store_{{ $ddsContract.Identifier }}, &mut events);
{{- end }}
{{- end }}
substreams::skip_empty_output();
Ok(events)
}
{{- end }}
Expand Down Expand Up @@ -457,6 +458,7 @@ let mut calls = contract::Calls::default();
{{- end }}
{{- end }}
{{- end }}
substreams::skip_empty_output();
Ok(calls)
}
{{- end }}
Expand Down
10 changes: 0 additions & 10 deletions ethfull/testoutput/bayc_triggers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ethfull/testoutput/bayc_triggers/substreams/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions ethfull/testoutput/bayc_triggers/substreams/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,14 @@ fn zipped_events_calls(
fn map_events(blk: eth::Block) -> Result<contract::Events, substreams::errors::Error> {
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<contract::Calls, substreams::errors::Error> {
let mut calls = contract::Calls::default();
map_bayc_calls(&blk, &mut calls);
substreams::skip_empty_output();
Ok(calls)
}

2 changes: 1 addition & 1 deletion ethfull/testoutput/complex_abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions ethfull/testoutput/complex_abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down
10 changes: 0 additions & 10 deletions ethfull/testoutput/uniswap_factory_v3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ fn map_unifactory_events(blk: &eth::Block, events: &mut contract::Events) {
fn map_events(blk: eth::Block) -> Result<contract::Events, substreams::errors::Error> {
let mut events = contract::Events::default();
map_unifactory_events(&blk, &mut events);
substreams::skip_empty_output();
Ok(events)
}

Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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)
}

2 changes: 1 addition & 1 deletion injective-events/templates/Cargo.toml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions injective-events/templates/lib.rs.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fn db_out(events: EventList) -> Result<DatabaseChanges, substreams::errors::Erro
let mut tables = DatabaseChangeTables::new();
let mut i = 0;

substreams::skip_empty_output();
events.events.into_iter().for_each(|event| {
let trx_hash = &event.transaction_hash;
let evt = event.event.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion starknet/templates/Cargo.toml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions starknet/templates/txfilter/lib.rs.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ fn db_out(transactions: Transactions) -> Result<DatabaseChanges, substreams::err
let block_number = transactions.clone().clock.unwrap().number;
let block_hash = transactions.clock.unwrap().id;

substreams::skip_empty_output();

transactions.transactions_with_receipt.into_iter().for_each(|trx| {
let trx_hash = &trx.receipt.unwrap().transaction_hash;
match trx.transaction {
Expand Down

0 comments on commit 00c0e3a

Please sign in to comment.