Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chain/ethereum/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ use crate::codec::HeaderOnlyBlock;
use crate::data_source::DataSourceTemplate;
use crate::data_source::UnresolvedDataSourceTemplate;
use crate::ingestor::PollingBlockIngestor;
use crate::json_block::EthereumJsonBlock;
use crate::network::EthereumNetworkAdapters;
use crate::polling_block_stream::PollingBlockStream;
use crate::runtime::runtime_adapter::eth_call_gas;
Expand All @@ -66,6 +65,7 @@ use graph::blockchain::block_stream::{
BlockStream, BlockStreamBuilder, BlockStreamError, BlockStreamMapper, FirehoseCursor,
TriggersAdapterWrapper,
};
use graph::components::ethereum::EthereumJsonBlock;
Comment thread
incrypto32 marked this conversation as resolved.
Outdated

/// Celo Mainnet: 42220, Testnet Alfajores: 44787, Testnet Baklava: 62320
const CELO_CHAIN_IDS: [u64; 3] = [42220, 44787, 62320];
Expand Down
2 changes: 1 addition & 1 deletion chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ use crate::adapter::EthereumRpcError;
use crate::adapter::ProviderStatus;
use crate::call_helper::interpret_eth_call_error;
use crate::chain::BlockFinality;
use crate::json_block::EthereumJsonBlock;
use crate::trigger::{LogPosition, LogRef};
use crate::Chain;
use crate::NodeCapabilities;
Expand All @@ -80,6 +79,7 @@ use crate::{
trigger::{EthereumBlockTriggerType, EthereumTrigger},
ENV_VARS,
};
use graph::components::ethereum::EthereumJsonBlock;

type AlloyProvider = FillProvider<
JoinFill<
Expand Down
2 changes: 0 additions & 2 deletions chain/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ mod data_source;
mod env;
mod ethereum_adapter;
mod ingestor;
mod json_block;
mod json_patch;
mod polling_block_stream;
pub mod runtime;
mod transport;
Expand Down
2 changes: 1 addition & 1 deletion chain/ethereum/src/transport.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::json_patch;
use alloy::transports::{TransportError, TransportErrorKind, TransportFut};
use graph::components::ethereum::json_patch;
use graph::components::network_provider::ProviderName;
use graph::endpoint::{ConnectionType, EndpointMetrics, RequestLabels};
use graph::prelude::alloy::rpc::json_rpc::{RequestPacket, ResponsePacket};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use graph::prelude::serde_json::{self as json, Value};
use graph::prelude::{EthereumBlock, LightEthereumBlock};
use serde_json::{self as json, Value};

use crate::json_patch;
use super::json_patch;
use super::types::{EthereumBlock, LightEthereumBlock};

#[derive(Debug)]
pub struct EthereumJsonBlock(Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
//!
//! Also used by `PatchingHttp` for chains that don't support EIP-2718 typed transactions.

use graph::prelude::serde_json::Value;
use serde_json::Value;

pub(crate) fn patch_type_field(obj: &mut Value) -> bool {
pub fn patch_type_field(obj: &mut Value) -> bool {
if let Value::Object(map) = obj {
if !map.contains_key("type") {
map.insert("type".to_string(), Value::String("0x0".to_string()));
Expand All @@ -19,7 +19,7 @@ pub(crate) fn patch_type_field(obj: &mut Value) -> bool {
false
}

pub(crate) fn patch_block_transactions(block: &mut Value) -> bool {
pub fn patch_block_transactions(block: &mut Value) -> bool {
let Some(txs) = block.get_mut("transactions").and_then(|t| t.as_array_mut()) else {
return false;
};
Expand All @@ -30,7 +30,7 @@ pub(crate) fn patch_block_transactions(block: &mut Value) -> bool {
patched
}

pub(crate) fn patch_receipts(result: &mut Value) -> bool {
pub fn patch_receipts(result: &mut Value) -> bool {
match result {
Value::Object(_) => patch_type_field(result),
Value::Array(arr) => {
Expand All @@ -47,7 +47,7 @@ pub(crate) fn patch_receipts(result: &mut Value) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use graph::prelude::serde_json::json;
use serde_json::json;

#[test]
fn patch_type_field_adds_missing_type() {
Expand Down
3 changes: 3 additions & 0 deletions graph/src/components/ethereum/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
pub mod json_block;
pub mod json_patch;
mod network;
mod types;

pub use self::json_block::EthereumJsonBlock;
pub use self::network::AnyNetworkBare;
pub use self::types::{
AnyBlock, AnyTransaction, AnyTransactionReceiptBare, EthereumBlock, EthereumBlockWithCalls,
Expand Down