Skip to content

Commit

Permalink
fix(arbitrum): implement timestamp and ack queries (#1883)
Browse files Browse the repository at this point in the history
these were left as stubs in #1868 as i hadn't tested packets yet.
  • Loading branch information
hussein-aitlahcen authored May 9, 2024
2 parents 5a3e331 + 44dce79 commit 1852e69
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 1852e69

Please sign in to comment.