Skip to content

Commit

Permalink
Merge pull request #323 from nomic-io/fix-return-relay
Browse files Browse the repository at this point in the history
Fix Eth return relay
  • Loading branch information
mappum authored Oct 28, 2024
2 parents a74b5b3 + 757f766 commit 78362b4
Show file tree
Hide file tree
Showing 4 changed files with 595 additions and 55 deletions.
18 changes: 2 additions & 16 deletions src/bin/nomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2964,25 +2964,10 @@ impl RelayEthereumCmd {
._0;
dbg!(&dest_str, amount, sender);

let rpc_client =
ethereum::consensus::relayer::RpcClient::new(self.beacon_api_url.clone());
// TODO: use chain_id in closure without breaking fn coercion
let lc = client.sub(move |app: InnerApp| Ok(app.ethereum.light_client(11155111)?));
let updates = ethereum::consensus::relayer::get_updates(&lc, &rpc_client).await?;
dbg!(updates.len());

let block_number = self
.config
.client()
.query(|app| {
Ok(app
.ethereum
.networks
.get(self.eth_chainid)?
.unwrap()
.light_client
.block_number())
})
.query(|app| Ok(app.ethereum.block_number(self.eth_chainid)?))
.await?;

log::debug!(
Expand All @@ -3001,6 +2986,7 @@ impl RelayEthereumCmd {

self.config
.client()
.with_wallet(crate::wallet())
.call(
move |app| {
build_call!(app.ethereum.relay_return(
Expand Down
Loading

0 comments on commit 78362b4

Please sign in to comment.