Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(arbitrum): implement timestamp and ack queries #1883

Merged
merged 1 commit into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading