Skip to content

Commit

Permalink
Minor fixes as follow-up from #364
Browse files Browse the repository at this point in the history
  • Loading branch information
adizere committed Nov 26, 2020
1 parent 53f97f6 commit ba30310
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions relayer/src/chain/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,8 @@ pub struct CosmosSDKChain {

impl CosmosSDKChain {
pub fn from_config(config: ChainConfig, rt: Arc<Mutex<TokioRuntime>>) -> Result<Self, Error> {
let primary = config
.primary()
.ok_or_else(|| Kind::LightClient.context("no primary peer specified"))?;

let rpc_client =
HttpClient::new(primary.address.clone()).map_err(|e| Kind::Rpc.context(e))?;
HttpClient::new(config.rpc_addr.clone()).map_err(|e| Kind::Rpc.context(e))?;

// Initialize key store and load key
let key_store = KeyRing::init(StoreBackend::Test, config.clone())
Expand Down
4 changes: 2 additions & 2 deletions relayer/src/chain/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct ChainRuntime<C: Chain> {
light_client: Box<dyn LightClient<C>>,

#[allow(dead_code)]
rt: Arc<Mutex<TokioRuntime>>,
rt: Arc<Mutex<TokioRuntime>>, // Making this future-proof, so we keep the runtime around.
}

impl ChainRuntime<CosmosSDKChain> {
Expand Down Expand Up @@ -96,7 +96,7 @@ impl ChainRuntime<CosmosSDKChain> {
// Spawn the event monitor
let event_monitor_thread = thread::spawn(move || event_monitor.run());

// Initialize the source and destination chain runtimes
// Initialize the chain runtime
let chain_runtime = Self::cosmos_sdk(config, light_client, event_receiver, rt)?;

// Get a handle to the runtime
Expand Down
2 changes: 0 additions & 2 deletions relayer/src/light_client/tendermint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ fn build_instance(
}

fn build_supervisor(config: &ChainConfig, reset: bool) -> Result<Supervisor, error::Error> {
let _id = config.id.clone();

let options = light_client::Options {
trust_threshold: config.trust_threshold,
trusting_period: config.trusting_period,
Expand Down

0 comments on commit ba30310

Please sign in to comment.