Skip to content

Commit f5db182

Browse files
JannisJannis Pohlmann
authored andcommitted
store/postgres: Add mapping entities to dynamic data source reversion test
These were not needed before, because we were not writing them to the store. However, that was a bug and since they are now being included in the meta data entities written to the store, we also need to include them in the expected entity changes.
1 parent 61a9816 commit f5db182

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

store/postgres/tests/store.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,18 @@ fn revert_block_with_dynamic_data_source_operations() {
18031803
tag: 3,
18041804
changes: HashSet::from_iter(
18051805
vec![
1806+
EntityChange {
1807+
subgraph_id: SubgraphDeploymentId::new("testsubgraph").unwrap(),
1808+
entity_type: "user".into(),
1809+
entity_id: "1".into(),
1810+
operation: EntityChangeOperation::Set,
1811+
},
1812+
EntityChange {
1813+
subgraph_id: SubgraphDeploymentId::new("subgraphs").unwrap(),
1814+
entity_type: "DynamicEthereumContractDataSource".into(),
1815+
entity_id: "dynamic-data-source".into(),
1816+
operation: EntityChangeOperation::Removed,
1817+
},
18061818
EntityChange {
18071819
subgraph_id: SubgraphDeploymentId::new("subgraphs").unwrap(),
18081820
entity_type: "EthereumContractSource".into(),
@@ -1811,15 +1823,15 @@ fn revert_block_with_dynamic_data_source_operations() {
18111823
},
18121824
EntityChange {
18131825
subgraph_id: SubgraphDeploymentId::new("subgraphs").unwrap(),
1814-
entity_type: "DynamicEthereumContractDataSource".into(),
1815-
entity_id: "dynamic-data-source".into(),
1826+
entity_type: "EthereumContractMapping".into(),
1827+
entity_id: "dynamic-data-source-mapping".into(),
18161828
operation: EntityChangeOperation::Removed,
18171829
},
18181830
EntityChange {
1819-
subgraph_id: SubgraphDeploymentId::new("testsubgraph").unwrap(),
1820-
entity_type: "user".into(),
1821-
entity_id: "1".into(),
1822-
operation: EntityChangeOperation::Set,
1831+
subgraph_id: SubgraphDeploymentId::new("subgraphs").unwrap(),
1832+
entity_type: "EthereumContractDataSourceTemplate".into(),
1833+
entity_id: "dynamic-data-source-templates-0".into(),
1834+
operation: EntityChangeOperation::Removed,
18231835
},
18241836
EntityChange {
18251837
subgraph_id: SubgraphDeploymentId::new("subgraphs").unwrap(),
@@ -1829,8 +1841,8 @@ fn revert_block_with_dynamic_data_source_operations() {
18291841
},
18301842
EntityChange {
18311843
subgraph_id: SubgraphDeploymentId::new("subgraphs").unwrap(),
1832-
entity_type: "EthereumContractDataSourceTemplate".into(),
1833-
entity_id: "dynamic-data-source-templates-0".into(),
1844+
entity_type: "EthereumContractMapping".into(),
1845+
entity_id: "dynamic-data-source-templates-0-mapping".into(),
18341846
operation: EntityChangeOperation::Removed,
18351847
},
18361848
]

0 commit comments

Comments
 (0)