diff --git a/blueprints/arbitrum-orbit/src/jobs/mod.rs b/blueprints/arbitrum-orbit/src/jobs/mod.rs index cd240d3..b732476 100644 --- a/blueprints/arbitrum-orbit/src/jobs/mod.rs +++ b/blueprints/arbitrum-orbit/src/jobs/mod.rs @@ -66,26 +66,30 @@ pub struct FeeRecipientParams { macro_rules! impl_node_script_job { ($job_name:ident, $params_type:ty, $id:expr) => { #[sdk::job( - id = $id, - params(params), - event_listener( - listener = TangleEventListener::, - pre_processor = services_pre_processor, - ), - )] + id = $id, + params(params), + event_listener( + listener = TangleEventListener::, + pre_processor = services_pre_processor, + ), + )] pub fn $job_name( params: $params_type, _context: ServiceContext, ) -> Result { let output = Command::new("node") - .arg(concat!("scripts/", stringify!($job_name).replace("_", "-"), ".ts")) + .arg(concat!( + "scripts/", + stringify!($job_name).replace("_", "-"), + ".ts" + )) .arg(serde_json::to_string(¶ms).unwrap()) .output()?; if !output.status.success() { return Err(std::io::Error::new( std::io::ErrorKind::Other, - String::from_utf8_lossy(&output.stderr).to_string() + String::from_utf8_lossy(&output.stderr).to_string(), )); } @@ -97,7 +101,7 @@ macro_rules! impl_node_script_job { // Job to set validators impl_node_script_job!(set_validators, ValidatorParams, 1); -// Job to add privileged executors +// Job to add privileged executors impl_node_script_job!(add_executors, ExecutorParams, 2); // Job to configure fast withdrawals @@ -107,4 +111,4 @@ impl_node_script_job!(configure_fast_withdrawals, FastWithdrawalParams, 3); impl_node_script_job!(manage_batch_posters, BatchPosterParams, 4); // Job to configure fee recipients -impl_node_script_job!(configure_fee_recipients, FeeRecipientParams, 5); \ No newline at end of file +impl_node_script_job!(configure_fee_recipients, FeeRecipientParams, 5); diff --git a/blueprints/arbitrum-orbit/src/lib.rs b/blueprints/arbitrum-orbit/src/lib.rs index e01a9a4..f5f53a6 100644 --- a/blueprints/arbitrum-orbit/src/lib.rs +++ b/blueprints/arbitrum-orbit/src/lib.rs @@ -4,7 +4,10 @@ use alloy_primitives::Address; use alloy_sol_types::sol; use color_eyre::eyre::Result; use gadget_sdk::load_abi; -use jobs::{manage_batch_posters, set_validators, BatchPosterParams, ServiceContext, TokenBridgeParams, ValidatorParams}; +use jobs::{ + manage_batch_posters, set_validators, BatchPosterParams, ServiceContext, TokenBridgeParams, + ValidatorParams, +}; use serde::{Deserialize, Serialize}; pub mod jobs; @@ -72,11 +75,14 @@ async fn setup_initial_configuration( if config.setup_token_bridge { let output = Command::new("node") .arg("scripts/configure-token-bridge.ts") - .arg(serde_json::to_string(&TokenBridgeParams { - rollup_address: deployment.rollup_address, - native_token: config.native_token.unwrap_or(Address::ZERO), - owner: config.owner, - }).unwrap()) + .arg( + serde_json::to_string(&TokenBridgeParams { + rollup_address: deployment.rollup_address, + native_token: config.native_token.unwrap_or(Address::ZERO), + owner: config.owner, + }) + .unwrap(), + ) .output()?; if !output.status.success() { @@ -104,4 +110,4 @@ async fn setup_initial_configuration( set_validators(validator_params, context.clone())?; Ok(()) -} \ No newline at end of file +} diff --git a/blueprints/arbitrum-orbit/src/main.rs b/blueprints/arbitrum-orbit/src/main.rs index 077ca60..931cac4 100644 --- a/blueprints/arbitrum-orbit/src/main.rs +++ b/blueprints/arbitrum-orbit/src/main.rs @@ -1,5 +1,12 @@ use alloy_primitives::Address; -use arbitrum_orbit_blueprint::{jobs::{AddExecutorsEventHandler, ConfigureFastWithdrawalsEventHandler, ConfigureFeeRecipientsEventHandler, ManageBatchPostersEventHandler, SetValidatorsEventHandler}, OrbitRaaSBlueprint}; +use arbitrum_orbit_blueprint::{ + jobs::{ + AddExecutorsEventHandler, ConfigureFastWithdrawalsEventHandler, + ConfigureFeeRecipientsEventHandler, ManageBatchPostersEventHandler, + SetValidatorsEventHandler, + }, + OrbitRaaSBlueprint, +}; use color_eyre::Result; use gadget_sdk::{self as sdk, utils::evm::get_provider_http}; use sdk::runners::tangle::TangleConfig; @@ -14,7 +21,7 @@ async fn main() -> Result<()> { let blueprint_address = Address::from([0; 20]); let contract = OrbitRaaSBlueprint::new(blueprint_address, provider); let rollup_config_return = contract.getRollupConfig(service_id).call().await?; - + let rollup_config = RollupConfig { chain_id: rollup_config_return.chainId, owner: rollup_config_return.owner, @@ -52,7 +59,8 @@ async fn main() -> Result<()> { // Initialize all jobs let set_validators = SetValidatorsEventHandler::new(&env, context).await?; let add_executors = AddExecutorsEventHandler::new(&env, context).await?; - let configure_fast_withdrawals = ConfigureFastWithdrawalsEventHandler::new(&env, context).await?; + let configure_fast_withdrawals = + ConfigureFastWithdrawalsEventHandler::new(&env, context).await?; let manage_batch_postesr = ManageBatchPostersEventHandler::new(&env, context).await?; let configure_fee_recipients = ConfigureFeeRecipientsEventHandler::new(&env, context).await?; @@ -64,8 +72,9 @@ async fn main() -> Result<()> { .job(configure_fast_withdraw) .job(manage_batch_posters) .job(configure_fee_recipients) - .run().await?; + .run() + .await?; gadget_sdk::info!("Exiting..."); Ok(()) -} \ No newline at end of file +}