Skip to content

Commit

Permalink
hyperlane-base: instantiate Aptos provider
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabaluev committed May 23, 2024
1 parent de3dde2 commit 2adbc00
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions rust/hyperlane-base/src/settings/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use ethers::prelude::Selector;
use h_cosmos::CosmosProvider;
use std::{collections::HashMap, sync::Arc};

use eyre::{eyre, Context, Result};
use ethers_prometheus::middleware::{ChainInfo, ContractInfo, PrometheusMiddlewareConf};
use eyre::{eyre, Context, Result};
use hyperlane_aptos as h_aptos;
use hyperlane_core::{
config::OperationBatchConfig, AggregationIsm, CcipReadIsm, ContractLocator, HyperlaneAbi,
Expand Down Expand Up @@ -198,7 +198,7 @@ impl ChainConf {
}
ChainConnectionConf::Aptos(conf) => {
let provider =
h_aptos::AptosHpProvider::new(locator.domain.clone(), conf.url.to_string());
h_aptos::AptosHpProvider::new(locator.domain.clone(), conf.url.clone());
Ok(Box::new(provider) as Box<dyn HyperlaneProvider>)
}
}
Expand Down Expand Up @@ -236,7 +236,7 @@ impl ChainConf {
ChainConnectionConf::Aptos(conf) => {
let keypair = self.aptos_signer().await.context(ctx)?;
h_aptos::AptosMailbox::new(conf, locator, keypair)
.map(|m| Box::new(m) as Box<dyn Mailbox>)
.map(|m| Box::new(m) as Box<dyn Mailbox>)
.map_err(Into::into)
}
}
Expand Down Expand Up @@ -271,11 +271,9 @@ impl ChainConf {

Ok(Box::new(hook) as Box<dyn MerkleTreeHook>)
}
ChainConnectionConf::Aptos(conf) => {
h_aptos::AptosMailbox::new(conf, locator, None)
.map(|m| Box::new(m) as Box<dyn MerkleTreeHook>)
.map_err(Into::into)
}
ChainConnectionConf::Aptos(conf) => h_aptos::AptosMailbox::new(conf, locator, None)
.map(|m| Box::new(m) as Box<dyn MerkleTreeHook>)
.map_err(Into::into),
}
.context(ctx)
}
Expand Down Expand Up @@ -405,7 +403,6 @@ impl ChainConf {
let paymaster = Box::new(h_aptos::AptosInterchainGasPaymaster::new(conf, &locator));
Ok(paymaster as Box<dyn InterchainGasPaymaster>)
}

}
.context(ctx)
}
Expand Down

0 comments on commit 2adbc00

Please sign in to comment.