Skip to content

Commit

Permalink
Remove emulate-hash, trace-hash and trace-next-block (#196)
Browse files Browse the repository at this point in the history
Remove emulate-hash, trace-hash and trace-next-block.
Delete everything related to accessing indexer database.
  • Loading branch information
anton-lisanin authored and afalaleev committed Oct 18, 2023
1 parent 25b178f commit 4dd963a
Show file tree
Hide file tree
Showing 29 changed files with 71 additions and 1,116 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
DHUBU: ${{secrets.DHUBU}}
DHUBP: ${{secrets.DHUBP}}
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
INDEXER_DB_PASSWORD: ${{secrets.INDEXER_DB_PASSWORD}}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
151 changes: 4 additions & 147 deletions evm_loader/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 2 additions & 13 deletions evm_loader/api/src/api_context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::NeonApiState;
use hex::FromHex;
use neon_lib::rpc::{CallDbClient, TrxDbClient};
use neon_lib::{context, rpc, NeonError};
use neon_lib::rpc::CallDbClient;
use neon_lib::{rpc, NeonError};
use std::sync::Arc;

pub async fn build_rpc_client(
Expand All @@ -23,13 +22,3 @@ pub async fn build_call_db_client(
CallDbClient::new(state.tracer_db.clone(), slot).await?,
))
}

pub async fn build_hash_rpc_client(
state: &NeonApiState,
hash: &str,
) -> Result<Arc<dyn rpc::Rpc>, NeonError> {
let hash = <[u8; 32]>::from_hex(context::truncate_0x(hash))?;
Ok(Arc::new(
TrxDbClient::new(state.tracer_db.clone(), state.indexer_db.clone(), hash).await,
))
}
4 changes: 2 additions & 2 deletions evm_loader/api/src/api_server/handlers/emulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::convert::Into;

use crate::api_server::handlers::process_error;
use crate::{
api_context, commands::emulate as EmulateCommand, context,
api_context, commands::emulate as EmulateCommand, context::Context,
types::request_models::EmulateRequestModel, NeonApiState,
};

Expand All @@ -21,7 +21,7 @@ pub async fn emulate(
Err(e) => return process_error(StatusCode::BAD_REQUEST, &e),
};

let context = context::create(rpc_client, state.config.clone());
let context = Context::new(rpc_client, state.config.clone());

let (token, chain, steps, accounts, solana_accounts) =
parse_emulation_params(&state.config, &context, &emulate_request.emulation_params).await;
Expand Down
58 changes: 0 additions & 58 deletions evm_loader/api/src/api_server/handlers/emulate_hash.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::api_server::handlers::process_error;
use crate::commands::get_ether_account_data as GetEtherAccountDataCommand;
use crate::{api_context, context, types::request_models::GetEtherRequest, NeonApiState};
use crate::{api_context, context::Context, types::request_models::GetEtherRequest, NeonApiState};
use axum::{
extract::{Query, State},
http::StatusCode,
Expand All @@ -19,8 +19,7 @@ pub async fn get_ether_account_data(
Ok(rpc_client) => rpc_client,
Err(e) => return process_error(StatusCode::BAD_REQUEST, &e),
};

let context = context::create(rpc_client, state.config.clone());
let context = Context::new(rpc_client, state.config.clone());

process_result(
&GetEtherAccountDataCommand::execute(
Expand Down
Loading

0 comments on commit 4dd963a

Please sign in to comment.