Skip to content

Commit

Permalink
fix(arbitrum): implement timestamp and ack queries
Browse files Browse the repository at this point in the history
  • Loading branch information
benluelo committed May 9, 2024
1 parent 5a3e331 commit 44dce79
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/chain-utils/src/arbitrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use ethers::{
contract::EthEvent,
providers::{Middleware, Provider, ProviderError, Ws, WsClientError},
};
use futures::TryFutureExt;
use serde::{Deserialize, Serialize};
use unionlabs::{
encoding::EthAbi,
Expand All @@ -24,8 +25,8 @@ use unionlabs::{

use crate::{
ethereum::{
self, get_proof, Ethereum, EthereumChain, EthereumInitError, EthereumSignerMiddleware,
EthereumSignersConfig, ReadWrite, Readonly,
self, get_proof, read_ack, Ethereum, EthereumChain, EthereumInitError,
EthereumSignerMiddleware, EthereumSignersConfig, ReadWrite, Readonly,
},
private_key::PrivateKey,
union::Union,
Expand Down Expand Up @@ -266,7 +267,7 @@ impl Chain for Arbitrum {
}

async fn query_latest_timestamp(&self) -> Result<i64, Self::Error> {
todo!()
self.l1.query_latest_timestamp().map_err(Into::into).await
}

async fn self_client_state(&self, height: Self::Height) -> Self::SelfClientState {
Expand Down Expand Up @@ -319,12 +320,19 @@ impl Chain for Arbitrum {

async fn read_ack(
&self,
_tx_hash: unionlabs::hash::H256,
_destination_channel_id: unionlabs::id::ChannelId,
_destination_port_id: unionlabs::id::PortId,
_sequence: std::num::NonZeroU64,
tx_hash: unionlabs::hash::H256,
destination_channel_id: unionlabs::id::ChannelId,
destination_port_id: unionlabs::id::PortId,
sequence: std::num::NonZeroU64,
) -> Vec<u8> {
todo!()
read_ack(
self,
tx_hash,
destination_port_id,
destination_channel_id,
sequence,
)
.await
}
}

Expand Down

0 comments on commit 44dce79

Please sign in to comment.