Skip to content

Commit

Permalink
graph: Rename BlockHandler input -> blockFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
fordN committed Jul 16, 2020
1 parent 1a31f83 commit b053022
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion graph/src/components/ethereum/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ impl EthereumBlockFilter {
.mapping
.block_handlers
.iter()
.map(|handler| handler.input)
.map(|handler| handler.block_format)
.max()
.unwrap_or(EthereumBlockHandlerData::Block)
.into();
Expand Down
4 changes: 2 additions & 2 deletions graph/src/data/subgraph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ impl UnresolvedMappingABI {
pub struct MappingBlockHandler {
pub handler: String,
pub filter: Option<BlockHandlerFilter>,
pub input: EthereumBlockHandlerData,
pub block_format: EthereumBlockHandlerData,
}

#[derive(Clone, Debug, Hash, Eq, PartialEq, Deserialize)]
Expand All @@ -531,7 +531,7 @@ impl From<EthereumBlockHandlerEntity> for MappingBlockHandler {
Self {
handler: entity.handler,
filter: None,
input: entity.input,
block_format: entity.block_format,
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions graph/src/data/subgraph/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ impl TryFromValue for EthereumContractAbiEntity {
pub struct EthereumBlockHandlerEntity {
pub handler: String,
pub filter: Option<EthereumBlockHandlerFilterEntity>,
pub input: EthereumBlockHandlerData,
pub block_format: EthereumBlockHandlerData,
}

impl WriteOperations for EthereumBlockHandlerEntity {
Expand All @@ -1026,7 +1026,7 @@ impl WriteOperations for EthereumBlockHandlerEntity {
if let Some(filter_id) = filter_id {
entity.set("filter", filter_id);
}
entity.set("input", self.input);
entity.set("input", self.block_format);
ops.add(Self::TYPENAME, id.to_owned(), entity);
}
}
Expand All @@ -1050,7 +1050,7 @@ impl From<super::MappingBlockHandler> for EthereumBlockHandlerEntity {
EthereumBlockHandlerEntity {
handler: block_handler.handler,
filter,
input: EthereumBlockHandlerData::from(block_handler.input),
block_format: EthereumBlockHandlerData::from(block_handler.block_format),
}
}
}
Expand All @@ -1068,7 +1068,7 @@ impl TryFromValue for EthereumBlockHandlerEntity {
Ok(EthereumBlockHandlerEntity {
handler: map.get_required("handler")?,
filter: map.get_optional("filter")?,
input: map.get_optional("input")?.unwrap_or_default(),
block_format: map.get_optional("blockFormat")?.unwrap_or_default(),
})
}
}
Expand Down

0 comments on commit b053022

Please sign in to comment.