Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 48c00b2

Browse files
deps: bump ibc-rs dependencies to reflect changes in v0.48.1 (#38)
* deps: bump ibc-rs deps to reflect changes in v0.48.1 * chore: implement newly added methods by ibc-rs * nit: touchups * chore: move away from ibc-proto * chore: further cleanups * chore: use std::io::Error
1 parent 7d92f33 commit 48c00b2

31 files changed

+901
-387
lines changed

Cargo.lock

+433-37
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+35-41
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,49 @@
11
[workspace]
22
resolver = "2"
3-
members = ["modules/sov-ibc", "modules/sov-ibc-transfer", "mocks"]
3+
members = ["modules/sov-ibc", "modules/sov-ibc-transfer", "mocks"]
44

55
[workspace.package]
6-
version = "0.1.0"
7-
edition = "2021"
8-
license = "MIT OR Apache-2.0"
9-
authors = ["Informal Systems <[email protected]>"]
10-
publish = false
11-
repository = "https://github.com/informalsystems/sovereign-ibc"
6+
version = "0.1.0"
7+
license = "MIT OR Apache-2.0"
8+
edition = "2021"
129
rust-version = "1.66"
10+
publish = false
11+
authors = ["Informal Systems <[email protected]>"]
12+
repository = "https://github.com/informalsystems/sovereign-ibc"
1313

1414
[workspace.dependencies]
15-
1615
# external dependencies
17-
anyhow = "1.0.68"
18-
borsh = { version = "0.10.3", features = ["rc", "bytes"] }
19-
bytes = "1.2.1"
16+
anyhow = "1.0.68"
17+
borsh = { version = "0.10.3", features = ["rc", "bytes"] }
18+
bytes = "1.2.1"
2019
derive_more = { version = "0.99.11", features = ["from", "try_into"] }
21-
digest = "0.10.6"
22-
hex = "0.4.3"
23-
jsonrpsee = { version = "0.20.1", features = [
24-
"jsonrpsee-types",
25-
"macros",
26-
"client",
27-
"server",
28-
] }
29-
prost = { version = "0.12", default-features = false }
30-
serde = { version = "1.0.188", features = ["derive", "rc"] }
31-
serde_json = "1.0"
32-
schemars = { version = "0.8.12", features = ["derive"] }
33-
tempfile = "3.5"
34-
thiserror = "1.0.38"
20+
digest = "0.10.6"
21+
hex = "0.4.3"
22+
jsonrpsee = { version = "0.20.1", features = ["jsonrpsee-types", "macros", "client", "server"] }
23+
prost = { version = "0.12", default-features = false }
24+
serde = { version = "1.0.188", features = ["derive", "rc"] }
25+
serde_json = "1.0"
26+
schemars = { version = "0.8.12", features = ["derive"] }
27+
tempfile = "3.5"
28+
thiserror = "1.0.38"
3529

3630
# ibc depedenencies
37-
ibc = { git = "https://github.com/cosmos/ibc-rs", rev = "b7dd19d", features = [
38-
"borsh",
39-
"schema",
40-
"serde",
41-
] }
42-
ibc-query = { git = "https://github.com/cosmos/ibc-rs", rev = "b7dd19d" }
31+
ibc-core = { git = "https://github.com/cosmos/ibc-rs", rev = "8e9213d", default-features = false, features = ["borsh","schema","serde"] }
32+
ibc-core-host-cosmos = { git = "https://github.com/cosmos/ibc-rs", rev = "8e9213d", default-features = false }
33+
ibc-client-tendermint = { git = "https://github.com/cosmos/ibc-rs", rev = "8e9213d", default-features = false }
34+
ibc-app-transfer = { git = "https://github.com/cosmos/ibc-rs", rev = "8e9213d", default-features = false }
35+
ibc-query = { git = "https://github.com/cosmos/ibc-rs", rev = "8e9213d", default-features = false }
36+
ibc-testkit = { git = "https://github.com/cosmos/ibc-rs", rev = "8e9213d", default-features = false }
4337

44-
# tendermint dependencies
45-
tendermint = { version = "0.34", default-features = false }
46-
tendermint-proto = { version = "0.34", default-features = false }
47-
tendermint-testgen = { version = "0.34", default-features = false }
38+
# cosmos dependencies
39+
tendermint = { version = "0.34", default-features = false }
40+
tendermint-proto = { version = "0.34", default-features = false }
41+
tendermint-testgen = { version = "0.34", default-features = false }
4842

4943
# sovereign dependencies
50-
sov-bank = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
51-
sov-chain-state = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
52-
sov-modules-api = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
53-
sov-modules-macros = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
54-
sov-state = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
55-
sov-rollup-interface = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
44+
sov-bank = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
45+
sov-chain-state = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
46+
sov-modules-api = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
47+
sov-modules-macros = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
48+
sov-state = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }
49+
sov-rollup-interface = { git = "https://github.com/informalsystems/sovereign-sdk.git", rev = "876eb0b" }

mocks/Cargo.toml

+29-23
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,49 @@
11
[package]
22
name = "sov-ibc-mocks"
3-
authors = { workspace = true }
4-
edition = { workspace = true }
5-
license = { workspace = true }
6-
repository = { workspace = true }
3+
authors = { workspace = true }
4+
edition = { workspace = true }
5+
license = { workspace = true }
6+
repository = { workspace = true }
77
rust-version = { workspace = true }
8-
version = { workspace = true }
9-
readme = "README.md"
10-
publish = false
11-
resolver = "2"
8+
version = { workspace = true }
9+
readme = "README.md"
10+
publish = false
1211

1312
[dependencies]
1413
# external dependencies
15-
prost = { workspace = true }
14+
prost = { workspace = true }
1615
serde_json = { workspace = true }
17-
tokio = { version = "1", features = ["full"] }
16+
tokio = { version = "1", features = ["full"] }
1817
tower-abci = "0.11"
19-
tower = { version = "0.4", features = ["full"] }
20-
tempfile = { workspace = true }
18+
tower = { version = "0.4", features = ["full"] }
19+
tempfile = { workspace = true }
2120

2221
# internal dependencies
23-
sov-ibc = { path = "../modules/sov-ibc" }
22+
sov-ibc = { path = "../modules/sov-ibc" }
2423
sov-ibc-transfer = { path = "../modules/sov-ibc-transfer" }
2524

2625
# ibc dependencies
27-
ibc = { workspace = true, features = ["mocks"] }
28-
ibc-proto = { version = "0.37.1", default-features = false, features = ["borsh"] }
29-
basecoin-app = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "823f846" }
30-
basecoin-store = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "823f846" }
31-
tendermint = { workspace = true }
32-
tendermint-testgen = { workspace = true }
26+
ibc-core = { workspace = true }
27+
ibc-app-transfer = { workspace = true }
28+
ibc-client-tendermint = { workspace = true }
29+
ibc-core-host-cosmos = { workspace = true }
30+
31+
# cosmos dependencies
32+
basecoin-app = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "d1cd0d7" }
33+
basecoin-store = { git = "https://github.com/informalsystems/basecoin-rs.git", rev = "d1cd0d7" }
34+
tendermint = { workspace = true }
35+
tendermint-testgen = { workspace = true }
3336

3437
# sovereign dependencies
35-
sov-bank = { workspace = true }
36-
sov-chain-state = { workspace = true }
37-
sov-modules-api = { workspace = true }
38-
sov-state = { workspace = true }
38+
sov-bank = { workspace = true }
39+
sov-chain-state = { workspace = true }
40+
sov-modules-api = { workspace = true }
41+
sov-state = { workspace = true }
3942
sov-rollup-interface = { workspace = true, features = ["mocks"] }
4043

44+
[dev-dependencies]
45+
ibc-testkit = { workspace = true }
46+
4147
[features]
4248
default = ["native"]
4349
native = [

mocks/src/cosmos/app.rs

+25-25
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,31 @@ use basecoin_app::{BaseCoinApp, Builder};
1111
use basecoin_store::context::{ProvableStore, Store};
1212
use basecoin_store::impls::RevertibleStore;
1313
use basecoin_store::utils::SharedRwExt;
14-
use ibc::clients::ics07_tendermint::client_type as tm_client_type;
15-
use ibc::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState;
16-
use ibc::core::ics02_client::client_state::ClientStateCommon;
17-
use ibc::core::ics02_client::ClientExecutionContext;
18-
use ibc::core::ics03_connection::connection::{
19-
ConnectionEnd, Counterparty as ConnCounterparty, State as ConnectionState,
14+
use ibc_client_tendermint::client_state::ClientState as TmClientState;
15+
use ibc_client_tendermint::types::{
16+
client_type as tm_client_type, ConsensusState as TmConsensusState,
2017
};
21-
use ibc::core::ics03_connection::version::Version as ConnectionVersion;
22-
use ibc::core::ics04_channel::channel::{
18+
use ibc_core::channel::types::channel::{
2319
ChannelEnd, Counterparty as ChanCounterparty, Order, State as ChannelState,
2420
};
25-
use ibc::core::ics04_channel::packet::Sequence;
26-
use ibc::core::ics04_channel::Version as ChannelVersion;
27-
use ibc::core::ics23_commitment::commitment::CommitmentProofBytes;
28-
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId};
29-
use ibc::core::ics24_host::path::{
21+
use ibc_core::channel::types::Version as ChannelVersion;
22+
use ibc_core::client::context::client_state::ClientStateCommon;
23+
use ibc_core::client::context::ClientExecutionContext;
24+
use ibc_core::client::types::Height;
25+
use ibc_core::commitment_types::commitment::CommitmentProofBytes;
26+
use ibc_core::connection::types::version::Version as ConnectionVersion;
27+
use ibc_core::connection::types::{
28+
ConnectionEnd, Counterparty as ConnCounterparty, State as ConnectionState,
29+
};
30+
use ibc_core::host::types::identifiers::{
31+
ChainId, ChannelId, ClientId, ConnectionId, PortId, Sequence,
32+
};
33+
use ibc_core::host::types::path::{
3034
ChannelEndPath, ClientConsensusStatePath, ClientStatePath, ConnectionPath, Path, SeqAckPath,
3135
SeqRecvPath, SeqSendPath,
3236
};
33-
use ibc::core::{ExecutionContext, ValidationContext};
34-
use ibc::hosts::tendermint::IBC_QUERY_PATH;
35-
use ibc::Height;
37+
use ibc_core::host::{ExecutionContext, ValidationContext};
38+
use ibc_core_host_cosmos::IBC_QUERY_PATH;
3639
use tendermint::abci::request::{InitChain, Query};
3740
use tendermint::block::Height as TmHeight;
3841
use tendermint::v0_37::abci::{Request as AbciRequest, Response as AbciResponse};
@@ -288,7 +291,7 @@ impl<S: ProvableStore + Default + Debug> MockCosmosChain<S> {
288291
let client_state =
289292
dummy_tm_client_state(self.chain_id.clone(), Height::new(0, 10).unwrap());
290293

291-
let latest_height = client_state.latest_height();
294+
let latest_height = TmClientState::from(client_state.clone()).latest_height();
292295

293296
self.ibc_ctx()
294297
.store_update_time(
@@ -309,17 +312,14 @@ impl<S: ProvableStore + Default + Debug> MockCosmosChain<S> {
309312
self.ibc_ctx().increase_client_counter().unwrap();
310313

311314
self.ibc_ctx()
312-
.store_client_state(client_state_path, client_state)
315+
.store_client_state(client_state_path, client_state.into())
313316
.unwrap();
314317

315-
let consensus_state_path =
316-
ClientConsensusStatePath::new(&client_id, &Height::new(0, 10).unwrap());
318+
let consensus_state_path = ClientConsensusStatePath::new(client_id.clone(), 0, 10);
317319

318-
let consensus_state = AnyConsensusState::Tendermint(TmConsensusState::new(
319-
vec![].into(),
320-
Time::now(),
321-
Hash::None,
322-
));
320+
let consensus_state = AnyConsensusState::Tendermint(
321+
TmConsensusState::new(vec![].into(), Time::now(), Hash::None).into(),
322+
);
323323

324324
self.ibc_ctx()
325325
.store_consensus_state(consensus_state_path, consensus_state)

mocks/src/cosmos/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::str::FromStr;
33
use std::sync::Arc;
44

55
use basecoin_store::context::ProvableStore;
6-
use ibc::core::ics24_host::identifier::ChainId;
6+
use ibc_core::host::types::identifiers::ChainId;
77
use tendermint_testgen::Validator;
88
use tokio::runtime::Runtime;
99

mocks/src/cosmos/handle.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ use std::fmt::Debug;
33
use basecoin_app::modules::ibc::{AnyConsensusState, IbcContext};
44
use basecoin_store::context::ProvableStore;
55
use basecoin_store::impls::RevertibleStore;
6-
use ibc::clients::ics07_tendermint::header::Header;
7-
use ibc::core::events::IbcEvent;
8-
use ibc::core::ics24_host::identifier::ChainId;
9-
use ibc::proto::Any;
10-
use ibc::Height;
6+
use ibc_client_tendermint::types::Header;
7+
use ibc_core::client::types::Height;
8+
use ibc_core::handler::types::events::IbcEvent;
9+
use ibc_core::host::types::identifiers::ChainId;
10+
use ibc_core::primitives::proto::Any;
1111

1212
use super::app::MockCosmosChain;
1313
use crate::relayer::handle::Handle;

mocks/src/cosmos/helpers/convert.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use ibc::core::ics23_commitment::merkle::MerkleProof;
2-
use ibc::proto::core::commitment::v1::MerkleProof as RawMerkleProof;
3-
use ibc_proto::ics23::CommitmentProof;
1+
use ibc_core::commitment_types::merkle::MerkleProof;
2+
use ibc_core::commitment_types::proto::ics23::CommitmentProof;
3+
use ibc_core::commitment_types::proto::v1::MerkleProof as RawMerkleProof;
44
use tendermint::merkle::proof::ProofOps;
55

66
pub fn convert_tm_to_ics_merkle_proof(tm_proof: &ProofOps) -> MerkleProof {

mocks/src/cosmos/helpers/dummy.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use std::time::Duration;
22

3-
use ibc::clients::ics07_tendermint::client_state::{AllowUpdate, ClientState};
4-
use ibc::core::ics24_host::identifier::ChainId;
5-
use ibc::Height;
3+
use ibc_client_tendermint::types::{AllowUpdate, ClientState};
4+
use ibc_core::client::types::Height;
5+
use ibc_core::host::types::identifiers::ChainId;
6+
use ibc_core::primitives::Signer;
67

78
pub fn dummy_tm_client_state(chain_id: ChainId, latest_hight: Height) -> ClientState {
89
ClientState::new(
@@ -22,8 +23,6 @@ pub fn dummy_tm_client_state(chain_id: ChainId, latest_hight: Height) -> ClientS
2223
.unwrap()
2324
}
2425

25-
use ibc::Signer;
26-
2726
pub fn genesis_app_state() -> serde_json::Value {
2827
serde_json::json!({
2928
"cosmos12xpmzmfpf7tn57xg93rne2hc2q26lcfql5efws": {

mocks/src/relayer/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::sync::Arc;
22

3-
use ibc::Signer;
3+
use ibc_core::primitives::Signer;
44

55
use super::handle::{Handle, QueryService};
66

mocks/src/relayer/handle.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::sync::Arc;
22

3-
use ibc::core::ics24_host::identifier::ChainId;
4-
use ibc::core::ValidationContext;
5-
use ibc::proto::Any;
6-
use ibc::Height;
3+
use ibc_core::client::types::Height;
4+
use ibc_core::host::types::identifiers::ChainId;
5+
use ibc_core::host::ValidationContext;
6+
use ibc_core::primitives::proto::Any;
77

88
/// Defines the interface that empowers a chain context with the ability to
99
/// query different states of a chain.

mocks/src/relayer/relay.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
use std::sync::Arc;
22

3-
use ibc::clients::ics07_tendermint::client_type as tm_client_type;
4-
use ibc::core::ics02_client::client_state::ClientStateCommon;
5-
use ibc::core::ics02_client::msgs::create_client::MsgCreateClient;
6-
use ibc::core::ics02_client::msgs::update_client::MsgUpdateClient;
7-
use ibc::core::ics04_channel::msgs::MsgRecvPacket;
8-
use ibc::core::ics04_channel::packet::{Packet, Sequence};
9-
use ibc::core::ics04_channel::timeout::TimeoutHeight;
10-
use ibc::core::ics24_host::identifier::{ChannelId, ClientId, PortId};
11-
use ibc::core::ics24_host::path::ReceiptPath;
12-
use ibc::core::timestamp::Timestamp;
13-
use ibc::core::{Msg, ValidationContext};
14-
use ibc::{Height, Signer};
3+
use ibc_client_tendermint::types::client_type as tm_client_type;
4+
use ibc_core::channel::types::msgs::MsgRecvPacket;
5+
use ibc_core::channel::types::packet::Packet;
6+
use ibc_core::channel::types::timeout::TimeoutHeight;
7+
use ibc_core::client::context::client_state::ClientStateCommon;
8+
use ibc_core::client::types::msgs::{MsgCreateClient, MsgUpdateClient};
9+
use ibc_core::client::types::Height;
10+
use ibc_core::host::types::identifiers::{ChannelId, ClientId, PortId, Sequence};
11+
use ibc_core::host::types::path::ReceiptPath;
12+
use ibc_core::host::ValidationContext;
13+
use ibc_core::primitives::{Msg, Signer, Timestamp};
1514
use sov_ibc::call::CallMessage;
1615
use sov_modules_api::default_context::DefaultContext;
1716

mocks/src/setup.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::time::Duration;
22

33
use basecoin_store::impls::InMemoryStore;
4-
use ibc::clients::ics07_tendermint::client_type as tm_client_type;
5-
use ibc::core::ics04_channel::packet::Sequence;
6-
use ibc::core::ics24_host::identifier::ClientId;
7-
use ibc::core::ValidationContext;
4+
use ibc_client_tendermint::types::client_type as tm_client_type;
5+
use ibc_core::host::types::identifiers::{ClientId, Sequence};
6+
use ibc_core::host::ValidationContext;
87
use tokio::time::sleep;
98

109
use super::cosmos::helpers::dummy_signer;

0 commit comments

Comments
 (0)