diff --git a/Cargo.lock b/Cargo.lock index 4d57354f8eb..b94154408ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -224,7 +224,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -235,7 +235,7 @@ dependencies = [ "composable-traits", "parity-scale-codec", "sp-api", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -672,7 +672,7 @@ dependencies = [ "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -691,7 +691,7 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -987,7 +987,7 @@ dependencies = [ "sp-core", "sp-finality-grandpa", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -999,7 +999,7 @@ dependencies = [ "frame-support", "parity-scale-codec", "scale-info", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1016,7 +1016,7 @@ dependencies = [ "scale-info", "serde", "sp-core", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1033,7 +1033,7 @@ dependencies = [ "sp-api", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-version", ] @@ -1050,7 +1050,7 @@ dependencies = [ "smallvec 1.8.0", "sp-api", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-version", ] @@ -1068,7 +1068,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-trie", ] @@ -1084,7 +1084,7 @@ dependencies = [ "sp-application-crypto", "sp-finality-grandpa", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1099,7 +1099,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1123,7 +1123,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-trie", ] @@ -1527,7 +1527,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-builder", "xcm-executor", @@ -1554,7 +1554,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1716,7 +1716,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -1742,7 +1742,7 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1758,7 +1758,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -1777,7 +1777,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -2094,7 +2094,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -2413,7 +2413,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -2429,7 +2429,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -2458,7 +2458,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-trie", "sp-version", "xcm", @@ -2486,7 +2486,7 @@ dependencies = [ "pallet-session", "parity-scale-codec", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -2502,7 +2502,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -2520,7 +2520,7 @@ dependencies = [ "rand_chacha 0.3.1", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -2538,7 +2538,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -2554,7 +2554,7 @@ dependencies = [ "polkadot-primitives", "sp-api", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-trie", ] @@ -2575,7 +2575,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-storage", "sp-trie", "tracing", @@ -2590,7 +2590,7 @@ dependencies = [ "futures 0.3.21", "parity-scale-codec", "sp-inherents", - "sp-std 4.0.0", + "sp-std", "sp-timestamp", ] @@ -2606,7 +2606,7 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-trie", "xcm", ] @@ -2700,7 +2700,7 @@ dependencies = [ "polkadot-primitives", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -2839,7 +2839,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -3552,7 +3552,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std 4.0.0", + "sp-std", "sp-storage", ] @@ -3630,7 +3630,7 @@ dependencies = [ "sp-arithmetic", "sp-npos-elections", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -3645,7 +3645,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-tracing", ] @@ -3686,7 +3686,7 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-tracing", "tt-call", ] @@ -3738,7 +3738,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-version", ] @@ -3754,7 +3754,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -3774,7 +3774,7 @@ dependencies = [ "frame-support", "sp-api", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -4495,8 +4495,8 @@ dependencies = [ [[package]] name = "ibc" -version = "0.14.1" -source = "git+https://github.com/ComposableFi/ibc-rs?rev=198440a62d4ccc88555cfef6253d6595319b88bf#198440a62d4ccc88555cfef6253d6595319b88bf" +version = "0.15.0" +source = "git+https://github.com/ComposableFi/ibc-rs?rev=c7c73ab423445f501ceae3d1d5d74815b502744a#c7c73ab423445f501ceae3d1d5d74815b502744a" dependencies = [ "beefy-generic-client", "beefy-primitives", @@ -4510,24 +4510,27 @@ dependencies = [ "parity-scale-codec", "prost 0.10.4", "prost-types 0.10.1", + "ripemd", "safe-regex", "serde", "serde_derive", "serde_json", "sha2 0.10.2", + "sha3 0.10.1", "sp-core", "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-trie", "subtle-encoding", "tendermint", "tendermint-light-client-verifier", - "tendermint-proto", + "tendermint-proto 0.23.7 (git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7)", "tendermint-testgen", "time 0.3.9", "tracing", + "uint", ] [[package]] @@ -4538,20 +4541,20 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 4.0.0", + "sp-std", ] [[package]] name = "ibc-proto" -version = "0.17.1" -source = "git+https://github.com/ComposableFi/ibc-rs?rev=198440a62d4ccc88555cfef6253d6595319b88bf#198440a62d4ccc88555cfef6253d6595319b88bf" +version = "0.18.0" +source = "git+https://github.com/ComposableFi/ibc-rs?rev=c7c73ab423445f501ceae3d1d5d74815b502744a#c7c73ab423445f501ceae3d1d5d74815b502744a" dependencies = [ "base64 0.13.0", "bytes 1.1.0", "prost 0.10.4", "prost-types 0.10.1", "serde", - "tendermint-proto", + "tendermint-proto 0.23.7 (git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7)", ] [[package]] @@ -4573,7 +4576,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-trie", - "tendermint-proto", + "tendermint-proto 0.23.7 (git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7)", ] [[package]] @@ -4582,7 +4585,7 @@ version = "0.1.0" dependencies = [ "ibc-primitives", "sp-api", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -4594,23 +4597,19 @@ dependencies = [ "ibc-primitives", "parity-scale-codec", "scale-info", - "sp-std 4.0.0", + "sp-std", ] [[package]] name = "ics23" version = "0.8.0-alpha" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a435f2471c1b2ce14771da465d47321c5905fac866d0effa9e0a3eb5d94fcf" +source = "git+https://github.com/composablefi/ics23?branch=seun-v0.8.0-alpha#c79df0901ddfdfb539dae1e451e7beadc01694f4" dependencies = [ "anyhow", "bytes 1.1.0", "hex", "prost 0.10.4", - "ripemd160", - "sha2 0.9.9", - "sha3 0.9.1", - "sp-std 3.0.0", + "sp-std", ] [[package]] @@ -5217,7 +5216,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "static_assertions", @@ -5318,7 +5317,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -6074,7 +6073,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "statemine-runtime", @@ -6939,7 +6938,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -6956,7 +6955,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -6971,7 +6970,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -6986,7 +6985,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -6998,7 +6997,7 @@ dependencies = [ "orml-traits", "parity-scale-codec", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -7018,7 +7017,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -7057,7 +7056,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7068,7 +7067,7 @@ dependencies = [ "composable-traits", "parity-scale-codec", "sp-api", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7085,7 +7084,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7112,7 +7111,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7126,7 +7125,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7146,7 +7145,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -7163,7 +7162,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7179,7 +7178,7 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7194,7 +7193,7 @@ dependencies = [ "scale-info", "sp-authorship", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7218,7 +7217,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7237,7 +7236,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-tracing", ] @@ -7253,7 +7252,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7269,7 +7268,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7292,7 +7291,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7318,7 +7317,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7336,7 +7335,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7353,7 +7352,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7374,7 +7373,7 @@ dependencies = [ "serde", "sp-finality-grandpa", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-trie", ] @@ -7396,7 +7395,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7414,7 +7413,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7433,7 +7432,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7453,7 +7452,7 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7470,7 +7469,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7496,7 +7495,7 @@ dependencies = [ "sp-io", "sp-keystore", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7516,7 +7515,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7539,7 +7538,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7555,7 +7554,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7581,7 +7580,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7616,7 +7615,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -7638,7 +7637,7 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "static_assertions", "strum 0.23.0", ] @@ -7671,7 +7670,7 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7686,7 +7685,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7704,7 +7703,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7727,7 +7726,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7752,19 +7751,21 @@ dependencies = [ "parachain-info", "parity-scale-codec", "prost 0.10.4", + "ripemd", "scale-info", "serde", - "sha2 0.9.9", + "sha2 0.10.2", + "sha3 0.10.1", "simple-iavl", "sp-core", "sp-io", "sp-keyring", "sp-runtime", "sp-runtime-interface", - "sp-std 4.0.0", + "sp-std", "sp-trie", "tendermint", - "tendermint-proto", + "tendermint-proto 0.23.7 (git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7)", ] [[package]] @@ -7785,8 +7786,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", - "tendermint-proto", + "sp-std", + "tendermint-proto 0.23.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7802,7 +7803,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7822,7 +7823,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7839,7 +7840,7 @@ dependencies = [ "sp-io", "sp-keyring", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7881,7 +7882,7 @@ dependencies = [ "sp-io", "sp-keystore", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -7915,7 +7916,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -7933,7 +7934,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7951,7 +7952,7 @@ dependencies = [ "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -7991,7 +7992,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -8007,7 +8008,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8027,7 +8028,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8041,7 +8042,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8056,7 +8057,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8075,7 +8076,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8092,7 +8093,7 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8115,7 +8116,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8141,7 +8142,7 @@ dependencies = [ "sp-io", "sp-keystore", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8168,7 +8169,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8183,7 +8184,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -8200,7 +8201,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8218,7 +8219,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8233,7 +8234,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8247,7 +8248,7 @@ dependencies = [ "safe-mix", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8262,7 +8263,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8278,7 +8279,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8298,7 +8299,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "sp-trie", ] @@ -8315,7 +8316,7 @@ dependencies = [ "rand 0.7.3", "sp-runtime", "sp-session", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8329,7 +8330,7 @@ dependencies = [ "rand_chacha 0.2.2", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8352,7 +8353,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8397,7 +8398,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8411,7 +8412,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8428,7 +8429,7 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-timestamp", ] @@ -8448,7 +8449,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8465,7 +8466,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8508,7 +8509,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8523,7 +8524,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8539,7 +8540,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8567,7 +8568,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8587,7 +8588,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8602,7 +8603,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -8618,7 +8619,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -8635,7 +8636,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -8674,7 +8675,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "substrate-wasm-builder", "xcm", "xcm-executor", @@ -9061,7 +9062,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -9368,7 +9369,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -9923,7 +9924,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -9966,7 +9967,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", "sp-trie", "sp-version", ] @@ -10079,7 +10080,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "static_assertions", @@ -10131,7 +10132,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "static_assertions", "xcm", ] @@ -10156,7 +10157,7 @@ dependencies = [ "bs58", "parity-scale-codec", "polkadot-primitives", - "sp-std 4.0.0", + "sp-std", "sp-tracing", ] @@ -10197,7 +10198,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "static_assertions", "xcm", "xcm-executor", @@ -10453,7 +10454,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] @@ -11212,14 +11213,12 @@ dependencies = [ ] [[package]] -name = "ripemd160" -version = "0.9.1" +name = "ripemd" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +checksum = "1facec54cb5e0dc08553501fa740091086d0259ad0067e0d4103448e4cb22ed3" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "opaque-debug 0.3.0", + "digest 0.10.3", ] [[package]] @@ -11300,7 +11299,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -12528,7 +12527,7 @@ dependencies = [ "serde_json", "sp-core", "sp-io", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -12547,7 +12546,7 @@ dependencies = [ "serde_json", "sp-core", "sp-io", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13198,7 +13197,7 @@ source = "git+https://github.com/polytope-labs/substrate-simnode?rev=920d5d7a032 dependencies = [ "parity-scale-codec", "sp-api", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13242,7 +13241,7 @@ checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" [[package]] name = "simple-iavl" version = "0.1.0" -source = "git+https://github.com/Wizdave97/simple-avl#2e19515bd19a87db4abd9a3b6affc7541dd6e56d" +source = "git+https://github.com/ComposableFi/simple-avl?rev=7f68d854e82b3e422565df7100dedd79e8ffa346#7f68d854e82b3e422565df7100dedd79e8ffa346" dependencies = [ "bytes 1.1.0", "ics23", @@ -13274,7 +13273,7 @@ dependencies = [ "parity-scale-codec", "paste 1.0.7", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13380,7 +13379,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-version", "thiserror", ] @@ -13407,7 +13406,7 @@ dependencies = [ "serde", "sp-core", "sp-io", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13421,7 +13420,7 @@ dependencies = [ "scale-info", "serde", "sp-debug-derive", - "sp-std 4.0.0", + "sp-std", "static_assertions", ] @@ -13435,7 +13434,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13447,7 +13446,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13459,7 +13458,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13494,7 +13493,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-version", "thiserror", ] @@ -13513,7 +13512,7 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-timestamp", ] @@ -13536,7 +13535,7 @@ dependencies = [ "sp-inherents", "sp-keystore", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-timestamp", ] @@ -13550,7 +13549,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-timestamp", ] @@ -13564,7 +13563,7 @@ dependencies = [ "schnorrkel", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13603,7 +13602,7 @@ dependencies = [ "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 4.0.0", + "sp-std", "sp-storage", "ss58-registry", "substrate-bip39", @@ -13623,7 +13622,7 @@ dependencies = [ "digest 0.10.3", "sha2 0.10.2", "sha3 0.10.1", - "sp-std 4.0.0", + "sp-std", "twox-hash", ] @@ -13664,7 +13663,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.22# dependencies = [ "environmental", "parity-scale-codec", - "sp-std 4.0.0", + "sp-std", "sp-storage", ] @@ -13683,7 +13682,7 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13696,7 +13695,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "thiserror", ] @@ -13717,7 +13716,7 @@ dependencies = [ "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-tracing", "sp-trie", "sp-wasm-interface", @@ -13774,7 +13773,7 @@ dependencies = [ "sp-core", "sp-debug-derive", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13788,7 +13787,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13840,7 +13839,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13853,7 +13852,7 @@ dependencies = [ "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 4.0.0", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -13881,7 +13880,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-io", - "sp-std 4.0.0", + "sp-std", "sp-wasm-interface", "wasmi", ] @@ -13906,7 +13905,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-staking", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13917,7 +13916,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13935,19 +13934,13 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std 4.0.0", + "sp-std", "sp-trie", "thiserror", "tracing", "trie-root", ] -[[package]] -name = "sp-std" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35391ea974fa5ee869cb094d5b437688fbf3d8127d64d1b9fed5822a1ed39b12" - [[package]] name = "sp-std" version = "4.0.0" @@ -13963,7 +13956,7 @@ dependencies = [ "ref-cast", "serde", "sp-debug-derive", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13976,7 +13969,7 @@ dependencies = [ "sp-externalities", "sp-io", "sp-runtime-interface", - "sp-std 4.0.0", + "sp-std", ] [[package]] @@ -13991,7 +13984,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "thiserror", ] @@ -14001,7 +13994,7 @@ version = "5.0.0" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.22#616d33ea23bab86cafffaf116fc607b6790fb4eb" dependencies = [ "parity-scale-codec", - "sp-std 4.0.0", + "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -14028,7 +14021,7 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-trie", ] @@ -14042,7 +14035,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core", - "sp-std 4.0.0", + "sp-std", "thiserror", "trie-db", "trie-root", @@ -14060,7 +14053,7 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "sp-version-proc-macro", "thiserror", ] @@ -14084,7 +14077,7 @@ dependencies = [ "impl-trait-for-tuples", "log 0.4.17", "parity-scale-codec", - "sp-std 4.0.0", + "sp-std", "wasmi", "wasmtime", ] @@ -14183,7 +14176,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -14491,7 +14484,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std 4.0.0", + "sp-std", "sp-trie", "trie-db", ] @@ -14620,8 +14613,7 @@ dependencies = [ [[package]] name = "tendermint" version = "0.23.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ca881fa4dedd2b46334f13be7fbc8cc1549ba4be5a833fe4e73d1a1baaf7949" +source = "git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7#cb79c164e84c3d9176b374f2b227393fe000e691" dependencies = [ "async-trait", "bytes 1.1.0", @@ -14641,7 +14633,7 @@ dependencies = [ "signature", "subtle", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.23.7 (git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7)", "time 0.3.9", "zeroize", ] @@ -14649,8 +14641,7 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" version = "0.23.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ae030a759b89cca84860d497d4d4e491615d8a9243cc04c61cd89335ba9b593" +source = "git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7#cb79c164e84c3d9176b374f2b227393fe000e691" dependencies = [ "derive_more", "flex-error", @@ -14677,11 +14668,27 @@ dependencies = [ "time 0.3.9", ] +[[package]] +name = "tendermint-proto" +version = "0.23.7" +source = "git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7#cb79c164e84c3d9176b374f2b227393fe000e691" +dependencies = [ + "bytes 1.1.0", + "flex-error", + "num-derive", + "num-traits", + "prost 0.10.4", + "prost-types 0.10.1", + "serde", + "serde_bytes", + "subtle-encoding", + "time 0.3.9", +] + [[package]] name = "tendermint-testgen" version = "0.23.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442ede2d01e61466e515fd7f1d0aac7c3c86b3066535479caa86a43afb5e2e17" +source = "git+https://github.com/composableFi/tendermint-rs?branch=seun-0.23.7#cb79c164e84c3d9176b374f2b227393fe000e691" dependencies = [ "ed25519-dalek", "gumdrop", @@ -16197,7 +16204,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std 4.0.0", + "sp-std", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", @@ -16450,7 +16457,7 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -16474,7 +16481,7 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-parachains", "sp-io", - "sp-std 4.0.0", + "sp-std", "xcm", "xcm-executor", ] @@ -16493,7 +16500,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 4.0.0", + "sp-std", "xcm", ] diff --git a/frame/ibc-ping/Cargo.toml b/frame/ibc-ping/Cargo.toml index fab8718fea8..b38a26f1687 100644 --- a/frame/ibc-ping/Cargo.toml +++ b/frame/ibc-ping/Cargo.toml @@ -21,13 +21,13 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot- sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } ibc-primitives = { path = "../ibc/ibc-primitives", default-features = false } ibc-trait = { path = "../ibc/ibc-trait", default-features = false } [dev-dependencies] balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" } -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", features = [ +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", features = [ "mocks", ] } pallet-ibc = { path = "../ibc" } diff --git a/frame/ibc-ping/src/lib.rs b/frame/ibc-ping/src/lib.rs index a47a92f26b1..2f326d2569e 100644 --- a/frame/ibc-ping/src/lib.rs +++ b/frame/ibc-ping/src/lib.rs @@ -13,7 +13,7 @@ use ibc::{ }, ics24_host::identifier::{ChannelId, ConnectionId, PortId}, ics26_routing::context::{ - Acknowledgement as GenericAcknowledgement, Module, ModuleOutput, OnRecvPacketAck, + Acknowledgement as GenericAcknowledgement, Module, ModuleOutputBuilder, OnRecvPacketAck, }, }, signer::Signer, @@ -176,7 +176,7 @@ impl core::fmt::Debug for IbcHandler { impl Module for IbcHandler { fn on_chan_open_init( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, _order: Order, _connection_hops: &[ConnectionId], _port_id: &PortId, @@ -190,12 +190,13 @@ impl Module for IbcHandler { fn on_chan_open_try( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, _order: Order, _connection_hops: &[ConnectionId], port_id: &PortId, channel_id: &ChannelId, counterparty: &Counterparty, + _version: &Version, counterparty_version: &Version, ) -> Result { log::info!("Channel initialised {:?}, {:?}, {:?}", channel_id, port_id, counterparty); @@ -204,7 +205,7 @@ impl Module for IbcHandler { fn on_chan_open_ack( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, port_id: &PortId, channel_id: &ChannelId, counterparty_version: &Version, @@ -220,7 +221,7 @@ impl Module for IbcHandler { fn on_chan_open_confirm( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, port_id: &PortId, channel_id: &ChannelId, ) -> Result<(), Ics04Error> { @@ -230,7 +231,7 @@ impl Module for IbcHandler { fn on_chan_close_init( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, port_id: &PortId, channel_id: &ChannelId, ) -> Result<(), Ics04Error> { @@ -240,7 +241,7 @@ impl Module for IbcHandler { fn on_chan_close_confirm( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, port_id: &PortId, channel_id: &ChannelId, ) -> Result<(), Ics04Error> { @@ -250,18 +251,18 @@ impl Module for IbcHandler { fn on_recv_packet( &self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, packet: &Packet, _relayer: &Signer, ) -> OnRecvPacketAck { let success = "ping-success".as_bytes().to_vec(); log::info!("Received Packet {:?}", packet); - OnRecvPacketAck::Successful(Box::new(PingAcknowledgement(success)), Box::new(|_| {})) + OnRecvPacketAck::Successful(Box::new(PingAcknowledgement(success)), Box::new(|_| Ok(()))) } fn on_acknowledgement_packet( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, packet: &Packet, acknowledgement: &Acknowledgement, _relayer: &Signer, @@ -272,7 +273,7 @@ impl Module for IbcHandler { fn on_timeout_packet( &mut self, - _output: &mut ModuleOutput, + _output: &mut ModuleOutputBuilder, packet: &Packet, _relayer: &Signer, ) -> Result<(), Ics04Error> { diff --git a/frame/ibc/Cargo.toml b/frame/ibc/Cargo.toml index 59b910c30d8..629b759f0a5 100644 --- a/frame/ibc/Cargo.toml +++ b/frame/ibc/Cargo.toml @@ -24,7 +24,7 @@ frame-system = { git = "https://github.com/paritytech/substrate", branch = "polk pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false, optional = true } parachain-info = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.22" } prost = { version = "0.10", default-features = false, optional = true } -simple-iavl = { git = "https://github.com/Wizdave97/simple-avl", default-features = false, optional = true } +simple-iavl = { git = "https://github.com/ComposableFi/simple-avl", rev = "7f68d854e82b3e422565df7100dedd79e8ffa346", default-features = false, optional = true } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false } sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false } @@ -33,32 +33,36 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false } hex-literal = { version = "0.3.4", optional = true } -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } -ibc-proto = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } -ics23 = { version = "=0.8.0-alpha", default-features = false, optional = true } -tendermint = { version = "0.23.7", optional = true, default-features = false } -tendermint-proto = { version = "0.23.7", default-features = false } +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } +ibc-proto = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } +ics23 = { git = "https://github.com/composablefi/ics23", branch = "seun-v0.8.0-alpha", default-features = false, optional = true } +tendermint = { git = "https://github.com/composableFi/tendermint-rs", branch = "seun-0.23.7", default-features = false, optional = true } +tendermint-proto = { git = "https://github.com/composableFi/tendermint-rs", branch = "seun-0.23.7", default-features = false } # local deps ibc-primitives = { path = "ibc-primitives", default-features = false } ibc-trait = { path = "ibc-trait", default-features = false } pallet-ibc-ping = { path = "../ibc-ping", default-features = false } +# To be removed in refactor here https://github.com/ComposableFi/composable/pull/1122 +sha2 = { version = "0.10.2", default-features = false } +sha3 = { version = "0.10.1", default-features = false } +ripemd = { version = "0.1.1", default-features = false } + [dev-dependencies] chrono = "0.4.19" hex = '0.4.0' hex-literal = { version = "0.3.4" } -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", features = [ +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", features = [ "mocks", ] } -ics23 = { version = "=0.8.0-alpha" } +ics23 = { git = "https://github.com/composablefi/ics23", branch = "seun-v0.8.0-alpha" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } prost = { version = "0.10" } serde = { version = "1.0" } -sha2 = '0.9.3' -simple-iavl = { git = "https://github.com/Wizdave97/simple-avl" } +simple-iavl = { git = "https://github.com/ComposableFi/simple-avl", rev = "7f68d854e82b3e422565df7100dedd79e8ffa346" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } -tendermint = { version = "0.23.7" } +tendermint = { git = "https://github.com/composableFi/tendermint-rs", branch = "seun-0.23.7" } [features] default = ['std'] @@ -81,6 +85,9 @@ std = [ "ibc-trait/std", "parachain-info/std", "sp-runtime-interface/std", + "sha3/std", + "sha2/std", + "ripemd/std" ] runtime-benchmarks = [ diff --git a/frame/ibc/ibc-primitives/Cargo.toml b/frame/ibc/ibc-primitives/Cargo.toml index bde77918cac..99cbf73bab1 100644 --- a/frame/ibc/ibc-primitives/Cargo.toml +++ b/frame/ibc/ibc-primitives/Cargo.toml @@ -10,7 +10,7 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive", ], default-features = false } -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } scale-info = { version = '2.1.1', default-features = false } serde = { version = "1.0.136", features = ["derive"], optional = true } sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } diff --git a/frame/ibc/ibc-rpc/Cargo.toml b/frame/ibc/ibc-rpc/Cargo.toml index 793100b71d8..e3e93d810cb 100644 --- a/frame/ibc/ibc-rpc/Cargo.toml +++ b/frame/ibc/ibc-rpc/Cargo.toml @@ -20,8 +20,8 @@ jsonrpsee = { version = "0.13.0", features = ["server", "macros"] } serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.45" -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } -ibc-proto = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } +ibc-proto = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } ibc-runtime-api = { path = "../ibc-runtime-api" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } @@ -30,4 +30,4 @@ sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "pol sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" } -tendermint-proto = "0.23.7" +tendermint-proto = {git = "https://github.com/composableFi/tendermint-rs", branch = "seun-0.23.7" } diff --git a/frame/ibc/ibc-trait/Cargo.toml b/frame/ibc/ibc-trait/Cargo.toml index cd06477c2bf..9d2d746a6d4 100644 --- a/frame/ibc/ibc-trait/Cargo.toml +++ b/frame/ibc/ibc-trait/Cargo.toml @@ -11,7 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = "derive", ] } frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", default-features = false } -ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "198440a62d4ccc88555cfef6253d6595319b88bf", default-features = false } +ibc = { git = "https://github.com/ComposableFi/ibc-rs", rev = "c7c73ab423445f501ceae3d1d5d74815b502744a", default-features = false } ibc-primitives = { path = "../ibc-primitives", default-features = false } scale-info = { version = "2.1.1", default-features = false, features = [ "derive", diff --git a/frame/ibc/src/benchmarks/benchmarking.rs b/frame/ibc/src/benchmarks/benchmarking.rs index 1bf9cc52cf3..b6f457e8284 100644 --- a/frame/ibc/src/benchmarks/benchmarking.rs +++ b/frame/ibc/src/benchmarks/benchmarking.rs @@ -73,7 +73,7 @@ benchmarks! { let msg = MsgCreateAnyClient::new( AnyClientState::Tendermint(mock_client_state), Some(AnyConsensusState::Tendermint(mock_cs_state)), - Signer::new("relayer"), + Signer::from_str(MODULE_ID).unwrap(), ) .unwrap() .encode_vec() @@ -136,7 +136,7 @@ benchmarks! { counterparty, version: None, delay_period, - signer: Signer::new("relayer") + signer: Signer::from_str(MODULE_ID).unwrap() }.encode_vec().unwrap(); let msg = Any { type_url: conn_open_init::TYPE_URL.as_bytes().to_vec(), value }; @@ -307,7 +307,7 @@ benchmarks! { let value = MsgChannelOpenInit { port_id: port_id.clone(), channel: channel_end, - signer: Signer::new("relayer") + signer: Signer::from_str(MODULE_ID).unwrap() }.encode_vec().unwrap(); let caller: T::AccountId = whitelisted_caller(); @@ -361,7 +361,7 @@ benchmarks! { let value = MsgChannelOpenInit { port_id, channel: channel_end, - signer: Signer::new("relayer") + signer: Signer::from_str(MODULE_ID).unwrap() }.encode_vec().unwrap(); let msg = ibc_proto::google::protobuf::Any { type_url: CHAN_OPEN_TYPE_URL.to_string(), value }; @@ -424,7 +424,7 @@ benchmarks! { let value = MsgChannelOpenInit { port_id, channel: channel_end, - signer: Signer::new("relayer") + signer: Signer::from_str(MODULE_ID).unwrap() }.encode_vec().unwrap(); let msg = ibc_proto::google::protobuf::Any { type_url: CHAN_OPEN_TYPE_URL.to_string(), value }; diff --git a/frame/ibc/src/benchmarks/tendermint_benchmark_utils.rs b/frame/ibc/src/benchmarks/tendermint_benchmark_utils.rs index e8aef79e9dc..c30e0eb0361 100644 --- a/frame/ibc/src/benchmarks/tendermint_benchmark_utils.rs +++ b/frame/ibc/src/benchmarks/tendermint_benchmark_utils.rs @@ -1,4 +1,4 @@ -use crate::{routing::Context, Config}; +use crate::{routing::Context, Config, MODULE_ID}; use core::{str::FromStr, time::Duration}; use frame_support::traits::Get; use ibc::{ @@ -146,7 +146,7 @@ pub fn create_client_update() -> MsgUpdateAnyClient { MsgUpdateAnyClient { client_id: ClientId::new(ClientType::Tendermint, 0).unwrap(), header: AnyHeader::Tendermint(create_tendermint_header()), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), } } // Proof generation process for all tendermint benchmarks @@ -263,7 +263,7 @@ pub fn create_conn_open_try() -> (ConsensusState, MsgConnectionOpenTr ) .unwrap(), delay_period, - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -366,7 +366,7 @@ pub fn create_conn_open_ack() -> (ConsensusState, MsgConnectionOpenAc ) .unwrap(), version: ConnVersion::default(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -454,7 +454,7 @@ pub fn create_conn_open_confirm() -> (ConsensusState, MsgConnectionOp Height::new(0, 2), ) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -517,7 +517,7 @@ pub fn create_chan_open_try() -> (ConsensusState, MsgChannelOpenTry) { counterparty_version: ChannelVersion::default(), proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -573,7 +573,7 @@ pub fn create_chan_open_ack() -> (ConsensusState, MsgChannelOpenAck) { counterparty_version: ChannelVersion::default(), proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -627,14 +627,18 @@ pub fn create_chan_open_confirm() -> (ConsensusState, MsgChannelOpenConfirm) { channel_id: ChannelId::new(0), proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } pub fn create_chan_close_init() -> MsgChannelCloseInit { let port_id = PortId::from_str(pallet_ibc_ping::PORT_ID).unwrap(); - MsgChannelCloseInit { port_id, channel_id: ChannelId::new(0), signer: Signer::new("relayer") } + MsgChannelCloseInit { + port_id, + channel_id: ChannelId::new(0), + signer: Signer::from_str(MODULE_ID).unwrap(), + } } pub fn create_chan_close_confirm() -> (ConsensusState, MsgChannelCloseConfirm) { @@ -686,7 +690,7 @@ pub fn create_chan_close_confirm() -> (ConsensusState, MsgChannelCloseConfirm) { channel_id: Default::default(), proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -751,7 +755,7 @@ where packet, proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -821,7 +825,7 @@ where acknowledgement: ack.into(), proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } @@ -886,7 +890,7 @@ where next_sequence_recv: Default::default(), proofs: Proofs::new(buf.try_into().unwrap(), None, None, None, Height::new(0, 2)) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), }, ) } diff --git a/frame/ibc/src/channel.rs b/frame/ibc/src/channel.rs index 1037f862067..f9123cca451 100644 --- a/frame/ibc/src/channel.rs +++ b/frame/ibc/src/channel.rs @@ -1,7 +1,8 @@ use super::*; use core::{str::FromStr, time::Duration}; use frame_support::traits::Get; -use scale_info::prelude::string::ToString; +use ibc_primitives::OffchainPacketType; +use scale_info::prelude::{collections::BTreeMap, string::ToString}; use crate::routing::Context; use ibc::{ @@ -18,6 +19,7 @@ use ibc::{ timestamp::Timestamp, Height, }; + use tendermint_proto::Protobuf; impl ChannelReader for Context @@ -285,6 +287,26 @@ where Ok(()) } + fn store_packet( + &mut self, + key: (PortId, ChannelId, Sequence), + packet: ibc::core::ics04_channel::packet::Packet, + ) -> Result<(), ICS04Error> { + // store packet offchain + let channel_id = key.1.to_string().as_bytes().to_vec(); + let port_id = key.0.as_bytes().to_vec(); + let seq = u64::from(key.2); + let key = Pallet::::offchain_key(channel_id, port_id); + let mut offchain_packets: BTreeMap = + sp_io::offchain::local_storage_get(sp_core::offchain::StorageKind::PERSISTENT, &key) + .and_then(|v| codec::Decode::decode(&mut &*v).ok()) + .unwrap_or_default(); + let offchain_packet: OffchainPacketType = packet.into(); + offchain_packets.insert(seq, offchain_packet); + sp_io::offchain_index::set(&key, offchain_packets.encode().as_slice()); + Ok(()) + } + fn delete_packet_commitment( &mut self, key: (PortId, ChannelId, Sequence), diff --git a/frame/ibc/src/events.rs b/frame/ibc/src/events.rs index 321a5433d1c..94ab923d5a8 100644 --- a/frame/ibc/src/events.rs +++ b/frame/ibc/src/events.rs @@ -29,13 +29,21 @@ pub enum IbcEvent { /// Client misbehaviour ClientMisbehaviour { client_id: Vec, revision_height: u64, revision_number: u64 }, /// Connection open init - OpenInitConnection { revision_height: u64, revision_number: u64, connection_id: Vec }, + OpenInitConnection { + revision_height: u64, + revision_number: u64, + connection_id: Option>, + }, /// Connection open confirm - OpenConfirmConnection { revision_height: u64, revision_number: u64, connection_id: Vec }, + OpenConfirmConnection { + revision_height: u64, + revision_number: u64, + connection_id: Option>, + }, /// Connection try open - OpenTryConnection { revision_height: u64, revision_number: u64, connection_id: Vec }, + OpenTryConnection { revision_height: u64, revision_number: u64, connection_id: Option> }, /// Connection open acknowledge - OpenAckConnection { revision_height: u64, revision_number: u64, connection_id: Vec }, + OpenAckConnection { revision_height: u64, revision_number: u64, connection_id: Option> }, /// Channel open init OpenInitChannel { revision_height: u64, @@ -131,6 +139,8 @@ pub enum IbcEvent { Empty, /// Chain Error ChainError, + /// Module event + AppModule, } impl From for IbcEvent { @@ -165,22 +175,22 @@ impl From for IbcEvent { RawIbcEvent::OpenInitConnection(ev) => IbcEvent::OpenInitConnection { revision_height: ev.height().revision_height, revision_number: ev.height().revision_number, - connection_id: ev.connection_id().clone().unwrap_or_default().as_bytes().to_vec(), + connection_id: ev.connection_id().map(|val| val.as_bytes().to_vec()), }, RawIbcEvent::OpenTryConnection(ev) => IbcEvent::OpenTryConnection { revision_height: ev.height().revision_height, revision_number: ev.height().revision_number, - connection_id: ev.connection_id().clone().unwrap_or_default().as_bytes().to_vec(), + connection_id: ev.connection_id().map(|val| val.as_bytes().to_vec()), }, RawIbcEvent::OpenAckConnection(ev) => IbcEvent::OpenAckConnection { revision_height: ev.height().revision_height, revision_number: ev.height().revision_number, - connection_id: ev.connection_id().clone().unwrap_or_default().as_bytes().to_vec(), + connection_id: ev.connection_id().map(|val| val.as_bytes().to_vec()), }, RawIbcEvent::OpenConfirmConnection(ev) => IbcEvent::OpenConfirmConnection { revision_height: ev.height().revision_height, revision_number: ev.height().revision_number, - connection_id: ev.connection_id().clone().unwrap_or_default().as_bytes().to_vec(), + connection_id: ev.connection_id().map(|val| val.as_bytes().to_vec()), }, RawIbcEvent::OpenInitChannel(ev) => IbcEvent::OpenInitChannel { revision_height: ev.height().revision_height, @@ -277,6 +287,7 @@ impl From for IbcEvent { }, RawIbcEvent::Empty(_) => IbcEvent::Empty, RawIbcEvent::ChainError(_) => IbcEvent::ChainError, + RawIbcEvent::AppModule(_) => IbcEvent::AppModule, } } } diff --git a/frame/ibc/src/host_functions.rs b/frame/ibc/src/host_functions.rs index 9175ce9a96f..b890166f7cd 100644 --- a/frame/ibc/src/host_functions.rs +++ b/frame/ibc/src/host_functions.rs @@ -9,7 +9,7 @@ use ibc::{ use sp_core::{storage::StateVersion, H256}; use sp_std::prelude::*; -#[derive(Clone)] +#[derive(Clone, Default)] pub struct HostFunctions; impl HostFunctionsProvider for HostFunctions { @@ -23,10 +23,6 @@ impl HostFunctionsProvider for HostFunctions { .map(|pub_key| pub_key.to_vec()) } - fn ed25519_recover(_signature: &[u8; 64], _value: &[u8; 32]) -> Option> { - unimplemented!() - } - fn verify_membership_trie_proof( root: &H256, proof: &[Vec], @@ -55,4 +51,60 @@ impl HostFunctionsProvider for HostFunctions { fn sha256_digest(data: &[u8]) -> [u8; 32] { sp_io::hashing::sha2_256(data) } + + // These are temporary implementations to fix build errors, will be replaced with + // host functions in https://github.com/ComposableFi/composable/pull/1122 + fn ripemd160(message: &[u8]) -> [u8; 20] { + use ripemd::Digest; + let mut hasher = ripemd::Ripemd160::new(); + hasher.update(message); + let hash = hasher.finalize(); + let mut res = [0u8; 20]; + res.copy_from_slice(&hash); + res + } + + fn ed25519_verify(signature: &[u8; 64], msg: &[u8], pubkey: &[u8]) -> bool { + let signature = sp_core::ed25519::Signature::from_raw(*signature); + let public_key = if let Ok(pub_key) = sp_core::ed25519::Public::try_from(pubkey) { + pub_key + } else { + return false + }; + sp_io::crypto::ed25519_verify(&signature, msg, &public_key) + } + + fn sha2_256(message: &[u8]) -> [u8; 32] { + sp_io::hashing::sha2_256(message) + } + + fn sha2_512(message: &[u8]) -> [u8; 64] { + use sha2::Digest; + let mut hasher = sha2::Sha512::new(); + hasher.update(message); + let hash = hasher.finalize(); + let mut res = [0u8; 64]; + res.copy_from_slice(&hash); + res + } + + fn sha2_512_truncated(message: &[u8]) -> [u8; 32] { + use sha2::Digest; + let mut hasher = sha2::Sha512::new(); + hasher.update(message); + let hash = hasher.finalize(); + let mut res = [0u8; 32]; + res.copy_from_slice(&hash[..32]); + res + } + + fn sha3_512(message: &[u8]) -> [u8; 64] { + use sha3::Digest; + let mut hasher = sha3::Sha3_512::new(); + hasher.update(message); + let hash = hasher.finalize(); + let mut res = [0u8; 64]; + res.copy_from_slice(&hash); + res + } } diff --git a/frame/ibc/src/impls.rs b/frame/ibc/src/impls.rs index 357f407e535..6da9fd26e27 100644 --- a/frame/ibc/src/impls.rs +++ b/frame/ibc/src/impls.rs @@ -636,9 +636,9 @@ where let next_seq_send = NextSequenceSend::::get(port_id.clone(), channel_id.clone()); let sequence = Sequence::from(next_seq_send); let source_port = - port_id_from_bytes(port_id.clone()).map_err(|_| IbcHandlerError::SendPacketError)?; - let source_channel = channel_id_from_bytes(channel_id.clone()) - .map_err(|_| IbcHandlerError::SendPacketError)?; + port_id_from_bytes(port_id).map_err(|_| IbcHandlerError::SendPacketError)?; + let source_channel = + channel_id_from_bytes(channel_id).map_err(|_| IbcHandlerError::SendPacketError)?; let destination_port = port_id_from_bytes(data.dest_port_id).map_err(|_| IbcHandlerError::SendPacketError)?; let destination_channel = channel_id_from_bytes(data.dest_channel_id) @@ -657,20 +657,10 @@ where }; let send_packet_result = - ibc::core::ics04_channel::handler::send_packet::send_packet(&ctx, packet.clone()) + ibc::core::ics04_channel::handler::send_packet::send_packet(&ctx, packet) .map_err(|_| IbcHandlerError::SendPacketError)?; ctx.store_packet_result(send_packet_result.result) .map_err(|_| IbcHandlerError::SendPacketError)?; - - // store packet offchain - let key = Pallet::::offchain_key(channel_id, port_id); - let mut offchain_packets: BTreeMap = - sp_io::offchain::local_storage_get(sp_core::offchain::StorageKind::PERSISTENT, &key) - .and_then(|v| codec::Decode::decode(&mut &*v).ok()) - .unwrap_or_default(); - let offchain_packet: OffchainPacketType = packet.into(); - offchain_packets.insert(next_seq_send, offchain_packet); - sp_io::offchain_index::set(&key, offchain_packets.encode().as_slice()); Ok(()) } @@ -683,9 +673,13 @@ where ctx.channel_counter().map_err(|_| IbcHandlerError::ChannelInitError)?; let channel_id = ChannelId::new(channel_counter); // Signer does not matter in this case - let value = MsgChannelOpenInit { port_id, channel: channel_end, signer: Signer::new("") } - .encode_vec() - .map_err(|_| IbcHandlerError::ChannelInitError)?; + let value = MsgChannelOpenInit { + port_id, + channel: channel_end, + signer: Signer::from_str(MODULE_ID).map_err(|_| IbcHandlerError::ChannelInitError)?, + } + .encode_vec() + .map_err(|_| IbcHandlerError::ChannelInitError)?; let msg = ibc_proto::google::protobuf::Any { type_url: CHANNEL_OPEN_INIT_TYPE_URL.to_string(), value, diff --git a/frame/ibc/src/lib.rs b/frame/ibc/src/lib.rs index 7dc2519d2cb..b13116463c9 100644 --- a/frame/ibc/src/lib.rs +++ b/frame/ibc/src/lib.rs @@ -53,6 +53,7 @@ mod port; pub mod routing; pub const IBC_DIGEST_ID: [u8; 4] = *b"/IBC"; +pub const MODULE_ID: &str = "pallet_ibc"; #[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] pub struct Any { @@ -127,6 +128,7 @@ pub mod pallet { version::Version, }, ics23_commitment::commitment::CommitmentPrefix, + ics26_routing::handler::MsgReceipt, }, signer::Signer, }; @@ -399,7 +401,7 @@ pub mod pallet { match ibc::core::ics26_routing::handler::deliver::<_, HostFunctions>( &mut ctx, msg, ) { - Ok((temp_events, temp_logs)) => { + Ok(MsgReceipt { events: temp_events, log: temp_logs }) => { events.extend_from_slice(&temp_events); logs.extend_from_slice(&temp_logs); }, @@ -450,7 +452,7 @@ pub mod pallet { counterparty, version: Some(version), delay_period, - signer: Signer::new(""), + signer: Signer::from_str(MODULE_ID).map_err(|_| Error::::DecodingError)?, } .encode_vec() .map_err(|_| Error::::ProcessingError)?; diff --git a/frame/ibc/src/port.rs b/frame/ibc/src/port.rs index 07c1fd896bf..53e874f72d0 100644 --- a/frame/ibc/src/port.rs +++ b/frame/ibc/src/port.rs @@ -2,10 +2,7 @@ use super::*; use crate::routing::Context; use ibc::core::{ - ics05_port::{ - context::{PortKeeper, PortReader}, - error::Error as ICS05Error, - }, + ics05_port::{context::PortReader, error::Error as ICS05Error}, ics24_host::identifier::PortId, ics26_routing::context::ModuleId, }; @@ -19,14 +16,3 @@ impl PortReader for Context { } } } - -impl PortKeeper for Context { - /// Since we are using statically defined ports and module Ids, this is not neccessary. - fn bind_module_to_port( - &mut self, - _module_id: ModuleId, - _port_id: PortId, - ) -> Result<(), ICS05Error> { - Ok(()) - } -} diff --git a/frame/ibc/src/routing.rs b/frame/ibc/src/routing.rs index e64242875b5..eed6ebb4127 100644 --- a/frame/ibc/src/routing.rs +++ b/frame/ibc/src/routing.rs @@ -1,9 +1,6 @@ use super::*; use core::borrow::Borrow; -use ibc::{ - applications::ics20_fungible_token_transfer::context::Ics20Context, - core::ics26_routing::context::{Ics26Context, LightClientContext, Module, ModuleId, Router}, -}; +use ibc::core::ics26_routing::context::{Ics26Context, Module, ModuleId, ReaderContext, Router}; use scale_info::prelude::string::ToString; #[derive(Clone)] @@ -66,12 +63,7 @@ where } } -impl Ics20Context for Context where - u32: From<::BlockNumber> -{ -} - -impl LightClientContext for Context where +impl ReaderContext for Context where u32: From<::BlockNumber> { } diff --git a/frame/ibc/src/tests.rs b/frame/ibc/src/tests.rs index dfe944cc0e3..5ac3b1d4139 100644 --- a/frame/ibc/src/tests.rs +++ b/frame/ibc/src/tests.rs @@ -1,4 +1,4 @@ -use crate::{mock::*, Any, ConnectionParams}; +use crate::{mock::*, Any, ConnectionParams, MODULE_ID}; use frame_support::{assert_ok, traits::Get}; use ibc::{ core::{ @@ -35,7 +35,7 @@ fn initialize_connection() { let msg = MsgCreateAnyClient::new( AnyClientState::Mock(mock_client_state), Some(AnyConsensusState::Mock(mock_cs_state)), - Signer::new("relayer"), + Signer::from_str(MODULE_ID).unwrap(), ) .unwrap() .encode_vec() @@ -73,7 +73,7 @@ fn should_open_a_channel() { let msg = MsgCreateAnyClient::new( AnyClientState::Mock(mock_client_state), Some(AnyConsensusState::Mock(mock_cs_state)), - Signer::new("relayer"), + Signer::from_str(MODULE_ID).unwrap(), ) .unwrap() .encode_vec() @@ -123,7 +123,7 @@ fn should_send_ping_packet() { let msg = MsgCreateAnyClient::new( AnyClientState::Mock(mock_client_state), Some(AnyConsensusState::Mock(mock_cs_state)), - Signer::new("relayer"), + Signer::from_str(MODULE_ID).unwrap(), ) .unwrap() .encode_vec() @@ -170,7 +170,7 @@ fn should_send_ping_packet() { ) .unwrap(), version: ConnVersion::default(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), } .encode_vec() .unwrap(); @@ -208,7 +208,7 @@ fn should_send_ping_packet() { Height::new(0, 1), ) .unwrap(), - signer: Signer::new("relayer"), + signer: Signer::from_str(MODULE_ID).unwrap(), } .encode_vec() .unwrap();