Skip to content

Commit

Permalink
Set compat_mode for pull mode in hermes listen command (#3911)
Browse files Browse the repository at this point in the history
* set compat_mode for pull mode

* add CHANGELOG
  • Loading branch information
tkxkd0159 authored Mar 22, 2024
1 parent b076784 commit 0783023
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Set `compat_mode` for pull mode in `hermes listen` command
([\#3910](https://github.com/informalsystems/hermes/issues/3910))
21 changes: 14 additions & 7 deletions crates/relayer-cli/src/commands/listen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use tracing::{error, info, instrument};
use ibc_relayer::{
chain::handle::Subscription,
config::{ChainConfig, EventSourceMode},
error::Error,
event::source::EventSource,
util::compat_mode::compat_mode_from_version,
};
Expand Down Expand Up @@ -159,13 +160,19 @@ fn subscribe(
EventSourceMode::Pull {
interval,
max_retries,
} => EventSource::rpc(
chain_config.id().clone(),
HttpClient::new(config.rpc_addr.clone())?,
*interval,
*max_retries,
rt,
),
} => {
let mut rpc_client = HttpClient::new(config.rpc_addr.clone())
.map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?;
rpc_client.set_compat_mode(compat_mode);

EventSource::rpc(
chain_config.id().clone(),
rpc_client,
*interval,
*max_retries,
rt,
)
}
}?;

thread::spawn(move || event_source.run());
Expand Down

0 comments on commit 0783023

Please sign in to comment.