Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: some rename #96

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions bin/bundler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ fn main() -> Result<()> {
.await?;
info!("Connected to uopool grpc");

let bundler_manager = BundlerService::new(
let bundler_service = BundlerService::new(
wallet,
opt.bundler_opts.beneficiary,
uopool_grpc_client.clone(),
opt.entry_points,
opt.eth_client_address.clone(),
);
info!("Starting bundler manager");
bundler_manager.start_bundling(opt.bundler_opts.bundle_interval);
bundler_service.start_bundling(opt.bundler_opts.bundle_interval);
info!("Starting bundler rpc server");
aa_bundler::bundler::service::run_server(
bundler_manager,
bundler_service,
opt.bundler_opts.bundler_grpc_listen_address,
);
info!(
Expand Down
2 changes: 2 additions & 0 deletions src/bundler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ use crate::{
utils::{parse_address, parse_u256},
};

pub const DEFAULT_INTERVAL: u64 = 10;

#[derive(Debug, Deserialize)]
pub enum Mode {
#[serde(rename = "auto")]
Expand Down
4 changes: 2 additions & 2 deletions src/bundler/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ impl Bundler for BundlerService {
}
}

pub fn run_server(bundler_manager: BundlerService, listen_address: SocketAddr) {
pub fn run_server(bundler_service: BundlerService, listen_address: SocketAddr) {
tokio::spawn(async move {
let mut builder = tonic::transport::Server::builder();
let svc = BundlerServer::new(bundler_manager);
let svc = BundlerServer::new(bundler_service);
builder.add_service(svc).serve(listen_address).await
});
}
3 changes: 1 addition & 2 deletions src/rpc/debug.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::debug_api::DebugApiServer;
use crate::{
bundler::Mode,
bundler::{Mode, DEFAULT_INTERVAL},
types::{reputation::ReputationEntry, user_operation::UserOperation},
uopool::server::{
bundler::{bundler_client::BundlerClient, Mode as GrpcMode, SetModeRequest},
Expand All @@ -17,7 +17,6 @@ use ethers::types::{Address, H256};
use jsonrpsee::core::RpcResult;
use tracing::{debug, trace};

const DEFAULT_INTERVAL: u64 = 10;
pub struct DebugApiServerImpl {
pub uopool_grpc_client: UoPoolClient<tonic::transport::Channel>,
pub bundler_grpc_client: BundlerClient<tonic::transport::Channel>,
Expand Down