Skip to content

Commit f1d7005

Browse files
committed
feat(cosmwasm): add query for committed client status
1 parent 8e70297 commit f1d7005

File tree

31 files changed

+63
-45
lines changed

31 files changed

+63
-45
lines changed

Cargo.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cosmwasm/ibc-union/core/light-client-interface/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use depolama::{QuerierExt, StorageExt, Store};
88
use frissitheto::UpgradeError;
99
use ibc_union::state::{ClientConsensusStates, ClientImpls, ClientStates, ClientStore, QueryStore};
1010
use ibc_union_msg::lightclient::{
11-
MisbehaviourResponse, QueryMsg, Status, StorageWrites, UpdateStateResponse,
12-
VerifyCreationResponse, VerifyCreationResponseEvent,
11+
MisbehaviourResponse, QueryMsg, StorageWrites, UpdateStateResponse, VerifyCreationResponse,
12+
VerifyCreationResponseEvent,
1313
};
14-
use ibc_union_spec::{ClientId, Timestamp};
14+
use ibc_union_spec::{path::Status, ClientId, Timestamp};
1515
use unionlabs::{
1616
encoding::{Decode, DecodeAs, DecodeErrorOf, Encode, EncodeAs, Encoding, EthAbi},
1717
primitives::Bytes,

cosmwasm/ibc-union/core/msg/src/query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub enum QueryMsg {
1616
GetClientState { client_id: ClientId },
1717
#[cfg_attr(feature = "cw-orch-interface", returns(unionlabs_primitives::Bytes))]
1818
GetConsensusState { client_id: ClientId, height: u64 },
19-
#[cfg_attr(feature = "cw-orch-interface", returns(crate::lightclient::Status))]
19+
#[cfg_attr(feature = "cw-orch-interface", returns(ibc_union_spec::path::Status))]
2020
GetStatus { client_id: ClientId },
21-
#[cfg_attr(feature = "cw-orch-interface", returns(crate::lightclient::Status))]
22-
GetCommittedStatus { client_id: ClientId, height: u64 },
21+
#[cfg_attr(feature = "cw-orch-interface", returns(ibc_union_spec::path::Status))]
22+
GetCommittedStatus { client_id: ClientId },
2323
#[cfg_attr(feature = "cw-orch-interface", returns(String))]
2424
GetClientType { client_id: ClientId },
2525
#[cfg_attr(feature = "cw-orch-interface", returns(ibc_union_spec::Connection))]

cosmwasm/ibc-union/core/src/contract.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ use ibc_union_msg::{
2828
use ibc_union_spec::{
2929
path::{
3030
commit_packets, BatchPacketsPath, BatchReceiptsPath, ChannelPath, ClientStatePath,
31-
ClientStatusPath, ConnectionPath, ConsensusStatePath, COMMITMENT_MAGIC,
32-
COMMITMENT_MAGIC_ACK, Status,
31+
ClientStatusPath, ConnectionPath, ConsensusStatePath, Status, COMMITMENT_MAGIC,
32+
COMMITMENT_MAGIC_ACK,
3333
},
3434
Channel, ChannelId, ChannelState, ClientId, Connection, ConnectionId, ConnectionState, Packet,
3535
Timestamp,
@@ -2194,7 +2194,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> Result<Binary, ContractErr
21942194
)?;
21952195
Ok(to_json_binary(&status)?)
21962196
}
2197-
QueryMsg::GetCommittedStatus { client_id, .. } => {
2197+
QueryMsg::GetCommittedStatus { client_id } => {
21982198
let commit = read_commit(deps, &ClientStatusPath { client_id }.key());
21992199
Ok(to_json_binary(&commit)?)
22002200
}

cosmwasm/ibc-union/core/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ mod tests;
1010

1111
use cosmwasm_std::{Addr, StdError};
1212
use frissitheto::UpgradeError;
13-
use ibc_union_spec::path::Status;
14-
use ibc_union_spec::{ChannelId, ChannelState, ClientId, ConnectionState, Timestamp};
13+
use ibc_union_spec::{path::Status, ChannelId, ChannelState, ClientId, ConnectionState, Timestamp};
1514
use thiserror::Error;
1615
use unionlabs::primitives::Bytes;
1716

cosmwasm/ibc-union/lightclient/arbitrum/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ethereum-light-client-types = { workspace = true }
2424
frissitheto = { workspace = true }
2525
ibc-union-light-client = { workspace = true }
2626
ibc-union-msg = { workspace = true }
27+
ibc-union-spec = { workspace = true }
2728
serde = { workspace = true, features = ["derive"] }
2829
thiserror = { workspace = true }
2930
unionlabs = { workspace = true, features = ["ethabi"] }

cosmwasm/ibc-union/lightclient/arbitrum/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use ethereum_light_client_types::StorageProof;
55
use ibc_union_light_client::{
66
spec::Timestamp, ClientCreationResult, IbcClient, IbcClientCtx, IbcClientError, StateUpdate,
77
};
8-
use ibc_union_msg::lightclient::Status;
8+
use ibc_union_spec::path::Status;
99
use unionlabs::encoding::Bincode;
1010

1111
use crate::errors::Error;

cosmwasm/ibc-union/lightclient/base/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ evm-storage-verifier = { workspace = true }
2828
frissitheto = { workspace = true }
2929
ibc-union-light-client = { workspace = true }
3030
ibc-union-msg = { workspace = true }
31+
ibc-union-spec = { workspace = true }
3132
ics23 = { workspace = true }
3233
serde = { workspace = true, features = ["derive"] }
3334
thiserror = { workspace = true }

cosmwasm/ibc-union/lightclient/base/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use ethereum_light_client_types::StorageProof;
55
use ibc_union_light_client::{
66
spec::Timestamp, ClientCreationResult, IbcClient, IbcClientCtx, IbcClientError, StateUpdate,
77
};
8-
use ibc_union_msg::lightclient::Status;
8+
use ibc_union_spec::path::Status;
99
use unionlabs::encoding::Bincode;
1010

1111
use crate::errors::Error;

cosmwasm/ibc-union/lightclient/berachain/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ evm-storage-verifier = { workspace = true }
2828
frissitheto = { workspace = true }
2929
ibc-union-light-client = { workspace = true }
3030
ibc-union-msg = { workspace = true }
31+
ibc-union-spec = { workspace = true }
3132
ics23 = { workspace = true }
3233
serde = { workspace = true, features = ["derive"] }
3334
tendermint-light-client = { workspace = true, features = ["library"] }

0 commit comments

Comments
 (0)