From 41887ef9a5622a78b9d4c33c5cf4a147aae87c05 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Tue, 19 Dec 2023 12:19:48 -0300 Subject: [PATCH 01/22] Fix overflow --- hyperspace/parachain/src/provider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hyperspace/parachain/src/provider.rs b/hyperspace/parachain/src/provider.rs index 8a563ecd8..ab48355c2 100644 --- a/hyperspace/parachain/src/provider.rs +++ b/hyperspace/parachain/src/provider.rs @@ -709,7 +709,7 @@ where // this update is required let base = if cfg!(test) { (session_length / 2) as u64 } else { (session_length / 12) as u64 }; - let diff = latest_height - latest_client_height_on_counterparty; + let diff = latest_height.saturating_sub(latest_client_height_on_counterparty); let pruning_len = 256; Ok(diff >= base.min(pruning_len as u64)) } From 21c8bc383e025eb993974d8416e25fa7695df5dd Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Tue, 19 Dec 2023 12:20:17 -0300 Subject: [PATCH 02/22] Fix overflow --- Cargo.lock | 42 +-- hyperspace/Cargo.toml | 2 +- hyperspace/core/Cargo.toml | 2 +- hyperspace/core/src/command.rs | 27 +- hyperspace/parachain/Cargo.toml | 2 +- utils/parachain-node/Cargo.toml | 2 +- utils/subxt/codegen/Cargo.toml | 2 +- .../generated/src/picasso_kusama/parachain.rs | 292 +++++++++--------- .../src/picasso_kusama/relaychain.rs | 282 ++++++++--------- 9 files changed, 339 insertions(+), 314 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 467622f79..e4cbdedcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1314,23 +1314,23 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", - "clap_derive 4.4.2", + "clap_derive 4.4.7", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", - "clap_lex 0.5.1", + "clap_lex 0.6.0", "strsim", ] @@ -1358,9 +1358,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -1379,9 +1379,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "coarsetime" @@ -1400,7 +1400,7 @@ name = "codegen" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.23", + "clap 4.4.11", "frame-metadata 15.1.0", "hex", "http", @@ -1931,7 +1931,7 @@ name = "cumulus-client-cli" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ - "clap 4.4.6", + "clap 4.4.11", "parity-scale-codec", "sc-chain-spec", "sc-cli", @@ -3533,7 +3533,7 @@ dependencies = [ "Inflector", "array-bytes 4.2.0", "chrono", - "clap 4.4.6", + "clap 4.4.11", "comfy-table", "frame-benchmarking", "frame-support", @@ -4579,7 +4579,7 @@ name = "hyperspace" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.23", + "clap 4.4.11", "hyperspace-core", "tokio", "toml 0.7.6", @@ -4591,7 +4591,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "clap 3.2.23", + "clap 4.4.11", "codegen", "derive_more", "env_logger 0.9.3", @@ -4708,7 +4708,7 @@ dependencies = [ "beefy-light-client", "beefy-light-client-primitives", "beefy-prover", - "clap 3.2.23", + "clap 4.4.11", "derive_more", "finality-grandpa", "frame-support", @@ -8533,7 +8533,7 @@ dependencies = [ name = "parachain-node" version = "0.1.0" dependencies = [ - "clap 4.4.6", + "clap 4.4.11", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -9077,7 +9077,7 @@ name = "polkadot-cli" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "clap 4.4.6", + "clap 4.4.11", "frame-benchmarking-cli", "futures", "log", @@ -11523,7 +11523,7 @@ source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9. dependencies = [ "array-bytes 4.2.0", "chrono", - "clap 4.4.6", + "clap 4.4.11", "fdlimit", "futures", "libp2p-identity", @@ -12374,7 +12374,7 @@ name = "sc-storage-monitor" version = "0.1.0" source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "clap 4.4.6", + "clap 4.4.11", "fs4", "futures", "log", @@ -15693,7 +15693,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "clap 4.4.6", + "clap 4.4.11", "frame-remote-externalities", "hex", "log", diff --git a/hyperspace/Cargo.toml b/hyperspace/Cargo.toml index 6620abea0..66c70f809 100644 --- a/hyperspace/Cargo.toml +++ b/hyperspace/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Seun Lanlege ", "David Salami Result<()> { tokio::fs::write(path.parse::()?, toml::to_string(config)?) .await diff --git a/hyperspace/parachain/Cargo.toml b/hyperspace/parachain/Cargo.toml index 5ea2ecf7d..ea8ba3551 100644 --- a/hyperspace/parachain/Cargo.toml +++ b/hyperspace/parachain/Cargo.toml @@ -92,7 +92,7 @@ sp-weights = { git = "https://github.com/paritytech/substrate", branch = "polkad [dev-dependencies] derive_more = "0.99.17" -clap = { version = "3.2.0", features = ["derive"] } +clap = { version = "4.4.11", features = ["derive"] } state-machine = { package = "sp-state-machine", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } prost = "0.11" primitives = { path = "../primitives", package = "hyperspace-primitives", features = [ diff --git a/utils/parachain-node/Cargo.toml b/utils/parachain-node/Cargo.toml index c73bcd188..0d1a4c71a 100644 --- a/utils/parachain-node/Cargo.toml +++ b/utils/parachain-node/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" build = "build.rs" [dependencies] -clap = { version = "4.0.22", features = ["derive"] } +clap = { version = "4.4.11", features = ["derive"] } derive_more = "0.99.2" log = "0.4.17" codec = { package = "parity-scale-codec", version = "3.0.0" } diff --git a/utils/subxt/codegen/Cargo.toml b/utils/subxt/codegen/Cargo.toml index 4697d8cf3..a7b8315e4 100644 --- a/utils/subxt/codegen/Cargo.toml +++ b/utils/subxt/codegen/Cargo.toml @@ -11,7 +11,7 @@ path = "bin/main.rs" [dependencies] tokio = { version = "1.32.0", features = ["full"] } anyhow = "1.0.66" -clap = { version = "3.2.22", features = ["derive", "env"] } +clap = { version = "4.4.11", features = ["derive", "env"] } serde_json = "1.0.91" http = "0.2.9" subxt-codegen = { git = "https://github.com/paritytech/subxt", tag = "v0.29.0" } diff --git a/utils/subxt/generated/src/picasso_kusama/parachain.rs b/utils/subxt/generated/src/picasso_kusama/parachain.rs index 4c9db4414..1e62a349c 100644 --- a/utils/subxt/generated/src/picasso_kusama/parachain.rs +++ b/utils/subxt/generated/src/picasso_kusama/parachain.rs @@ -186,14 +186,14 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Sudo" { return Ok(Event::Sudo(sudo::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "TransactionPayment" { return Ok(Event::TransactionPayment( @@ -202,42 +202,42 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Indices" { return Ok(Event::Indices(indices::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Balances" { return Ok(Event::Balances(balances::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Identity" { return Ok(Event::Identity(identity::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Multisig" { return Ok(Event::Multisig(multisig::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParachainSystem" { return Ok(Event::ParachainSystem(parachain_system::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CollatorSelection" { return Ok(Event::CollatorSelection( @@ -246,21 +246,21 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Session" { return Ok(Event::Session(session::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Council" { return Ok(Event::Council(council::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CouncilMembership" { return Ok(Event::CouncilMembership( @@ -269,14 +269,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Treasury" { return Ok(Event::Treasury(treasury::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "TechnicalCommittee" { return Ok(Event::TechnicalCommittee( @@ -285,7 +285,7 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "TechnicalCommitteeMembership" { return Ok(Event::TechnicalCommitteeMembership( @@ -294,14 +294,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "ReleaseCommittee" { return Ok(Event::ReleaseCommittee(release_committee::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ReleaseMembership" { return Ok(Event::ReleaseMembership( @@ -310,14 +310,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "RelayerCommittee" { return Ok(Event::RelayerCommittee(relayer_committee::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "RelayerCommitteeMembership" { return Ok(Event::RelayerCommitteeMembership( @@ -326,182 +326,182 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Scheduler" { return Ok(Event::Scheduler(scheduler::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Utility" { return Ok(Event::Utility(utility::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Preimage" { return Ok(Event::Preimage(preimage::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Proxy" { return Ok(Event::Proxy(proxy::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "XcmpQueue" { return Ok(Event::XcmpQueue(xcmp_queue::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "PolkadotXcm" { return Ok(Event::PolkadotXcm(polkadot_xcm::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CumulusXcm" { return Ok(Event::CumulusXcm(cumulus_xcm::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "DmpQueue" { return Ok(Event::DmpQueue(dmp_queue::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "XTokens" { return Ok(Event::XTokens(x_tokens::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "UnknownTokens" { return Ok(Event::UnknownTokens(unknown_tokens::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Tokens" { return Ok(Event::Tokens(tokens::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CrowdloanRewards" { return Ok(Event::CrowdloanRewards(crowdloan_rewards::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Vesting" { return Ok(Event::Vesting(vesting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "AssetsRegistry" { return Ok(Event::AssetsRegistry(assets_registry::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Pablo" { return Ok(Event::Pablo(pablo::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Oracle" { return Ok(Event::Oracle(oracle::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "FarmingRewards" { return Ok(Event::FarmingRewards(farming_rewards::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Farming" { return Ok(Event::Farming(farming::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Referenda" { return Ok(Event::Referenda(referenda::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ConvictionVoting" { return Ok(Event::ConvictionVoting(conviction_voting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Whitelist" { return Ok(Event::Whitelist(whitelist::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CallFilter" { return Ok(Event::CallFilter(call_filter::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Cosmwasm" { return Ok(Event::Cosmwasm(cosmwasm::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Ibc" { return Ok(Event::Ibc(ibc::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Ics20Fee" { return Ok(Event::Ics20Fee(ics20_fee::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "PalletMultihopXcmIbc" { return Ok(Event::PalletMultihopXcmIbc( @@ -510,14 +510,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "PalletXcmHelper" { return Ok(Event::PalletXcmHelper(pallet_xcm_helper::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "PalletLiquidStaking" { return Ok(Event::PalletLiquidStaking( @@ -526,14 +526,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "RevenueIbc" { return Ok(Event::RevenueIbc(revenue_ibc::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Event enum", @@ -669,105 +669,105 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Timestamp" { return Ok(Call::Timestamp(timestamp::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Sudo" { return Ok(Call::Sudo(sudo::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "AssetTxPayment" { return Ok(Call::AssetTxPayment(asset_tx_payment::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Indices" { return Ok(Call::Indices(indices::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Balances" { return Ok(Call::Balances(balances::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Identity" { return Ok(Call::Identity(identity::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Multisig" { return Ok(Call::Multisig(multisig::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParachainSystem" { return Ok(Call::ParachainSystem(parachain_system::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParachainInfo" { return Ok(Call::ParachainInfo(parachain_info::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CollatorSelection" { return Ok(Call::CollatorSelection(collator_selection::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Session" { return Ok(Call::Session(session::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Council" { return Ok(Call::Council(council::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CouncilMembership" { return Ok(Call::CouncilMembership(council_membership::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Treasury" { return Ok(Call::Treasury(treasury::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "TechnicalCommittee" { return Ok(Call::TechnicalCommittee( @@ -776,7 +776,7 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "TechnicalCommitteeMembership" { return Ok(Call::TechnicalCommitteeMembership( @@ -785,28 +785,28 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "ReleaseCommittee" { return Ok(Call::ReleaseCommittee(release_committee::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ReleaseMembership" { return Ok(Call::ReleaseMembership(release_membership::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "RelayerCommittee" { return Ok(Call::RelayerCommittee(relayer_committee::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "RelayerCommitteeMembership" { return Ok(Call::RelayerCommitteeMembership( @@ -815,189 +815,189 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Scheduler" { return Ok(Call::Scheduler(scheduler::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Utility" { return Ok(Call::Utility(utility::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Preimage" { return Ok(Call::Preimage(preimage::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Proxy" { return Ok(Call::Proxy(proxy::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "XcmpQueue" { return Ok(Call::XcmpQueue(xcmp_queue::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "PolkadotXcm" { return Ok(Call::PolkadotXcm(polkadot_xcm::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CumulusXcm" { return Ok(Call::CumulusXcm(cumulus_xcm::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "DmpQueue" { return Ok(Call::DmpQueue(dmp_queue::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "XTokens" { return Ok(Call::XTokens(x_tokens::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "UnknownTokens" { return Ok(Call::UnknownTokens(unknown_tokens::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Tokens" { return Ok(Call::Tokens(tokens::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CrowdloanRewards" { return Ok(Call::CrowdloanRewards(crowdloan_rewards::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Vesting" { return Ok(Call::Vesting(vesting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Assets" { return Ok(Call::Assets(assets::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "AssetsRegistry" { return Ok(Call::AssetsRegistry(assets_registry::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Pablo" { return Ok(Call::Pablo(pablo::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Oracle" { return Ok(Call::Oracle(oracle::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "FarmingRewards" { return Ok(Call::FarmingRewards(farming_rewards::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Farming" { return Ok(Call::Farming(farming::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Referenda" { return Ok(Call::Referenda(referenda::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ConvictionVoting" { return Ok(Call::ConvictionVoting(conviction_voting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Whitelist" { return Ok(Call::Whitelist(whitelist::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "CallFilter" { return Ok(Call::CallFilter(call_filter::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Cosmwasm" { return Ok(Call::Cosmwasm(cosmwasm::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Ibc" { return Ok(Call::Ibc(ibc::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Ics20Fee" { return Ok(Call::Ics20Fee(ics20_fee::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "PalletMultihopXcmIbc" { return Ok(Call::PalletMultihopXcmIbc( @@ -1006,14 +1006,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "PalletXcmHelper" { return Ok(Call::PalletXcmHelper(pallet_xcm_helper::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "PalletLiquidStaking" { return Ok(Call::PalletLiquidStaking( @@ -1022,14 +1022,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "RevenueIbc" { return Ok(Call::RevenueIbc(revenue_ibc::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Call enum", @@ -1154,226 +1154,226 @@ pub mod api { let cursor = &mut &pallet_bytes[..]; if pallet_name == "System" { let variant_error = system::Error::decode_with_metadata(cursor, 439u32, metadata)?; - return Ok(Error::System(variant_error)) + return Ok(Error::System(variant_error)); } if pallet_name == "Sudo" { let variant_error = sudo::Error::decode_with_metadata(cursor, 440u32, metadata)?; - return Ok(Error::Sudo(variant_error)) + return Ok(Error::Sudo(variant_error)); } if pallet_name == "Indices" { let variant_error = indices::Error::decode_with_metadata(cursor, 443u32, metadata)?; - return Ok(Error::Indices(variant_error)) + return Ok(Error::Indices(variant_error)); } if pallet_name == "Balances" { let variant_error = balances::Error::decode_with_metadata(cursor, 457u32, metadata)?; - return Ok(Error::Balances(variant_error)) + return Ok(Error::Balances(variant_error)); } if pallet_name == "Identity" { let variant_error = identity::Error::decode_with_metadata(cursor, 468u32, metadata)?; - return Ok(Error::Identity(variant_error)) + return Ok(Error::Identity(variant_error)); } if pallet_name == "Multisig" { let variant_error = multisig::Error::decode_with_metadata(cursor, 472u32, metadata)?; - return Ok(Error::Multisig(variant_error)) + return Ok(Error::Multisig(variant_error)); } if pallet_name == "ParachainSystem" { let variant_error = parachain_system::Error::decode_with_metadata(cursor, 488u32, metadata)?; - return Ok(Error::ParachainSystem(variant_error)) + return Ok(Error::ParachainSystem(variant_error)); } if pallet_name == "CollatorSelection" { let variant_error = collator_selection::Error::decode_with_metadata(cursor, 493u32, metadata)?; - return Ok(Error::CollatorSelection(variant_error)) + return Ok(Error::CollatorSelection(variant_error)); } if pallet_name == "Session" { let variant_error = session::Error::decode_with_metadata(cursor, 498u32, metadata)?; - return Ok(Error::Session(variant_error)) + return Ok(Error::Session(variant_error)); } if pallet_name == "Council" { let variant_error = council::Error::decode_with_metadata(cursor, 504u32, metadata)?; - return Ok(Error::Council(variant_error)) + return Ok(Error::Council(variant_error)); } if pallet_name == "CouncilMembership" { let variant_error = council_membership::Error::decode_with_metadata(cursor, 506u32, metadata)?; - return Ok(Error::CouncilMembership(variant_error)) + return Ok(Error::CouncilMembership(variant_error)); } if pallet_name == "Treasury" { let variant_error = treasury::Error::decode_with_metadata(cursor, 510u32, metadata)?; - return Ok(Error::Treasury(variant_error)) + return Ok(Error::Treasury(variant_error)); } if pallet_name == "TechnicalCommittee" { let variant_error = technical_committee::Error::decode_with_metadata(cursor, 511u32, metadata)?; - return Ok(Error::TechnicalCommittee(variant_error)) + return Ok(Error::TechnicalCommittee(variant_error)); } if pallet_name == "TechnicalCommitteeMembership" { let variant_error = technical_committee_membership::Error::decode_with_metadata( cursor, 512u32, metadata, )?; - return Ok(Error::TechnicalCommitteeMembership(variant_error)) + return Ok(Error::TechnicalCommitteeMembership(variant_error)); } if pallet_name == "ReleaseCommittee" { let variant_error = release_committee::Error::decode_with_metadata(cursor, 514u32, metadata)?; - return Ok(Error::ReleaseCommittee(variant_error)) + return Ok(Error::ReleaseCommittee(variant_error)); } if pallet_name == "ReleaseMembership" { let variant_error = release_membership::Error::decode_with_metadata(cursor, 516u32, metadata)?; - return Ok(Error::ReleaseMembership(variant_error)) + return Ok(Error::ReleaseMembership(variant_error)); } if pallet_name == "RelayerCommittee" { let variant_error = relayer_committee::Error::decode_with_metadata(cursor, 517u32, metadata)?; - return Ok(Error::RelayerCommittee(variant_error)) + return Ok(Error::RelayerCommittee(variant_error)); } if pallet_name == "RelayerCommitteeMembership" { let variant_error = relayer_committee_membership::Error::decode_with_metadata( cursor, 518u32, metadata, )?; - return Ok(Error::RelayerCommitteeMembership(variant_error)) + return Ok(Error::RelayerCommitteeMembership(variant_error)); } if pallet_name == "Scheduler" { let variant_error = scheduler::Error::decode_with_metadata(cursor, 523u32, metadata)?; - return Ok(Error::Scheduler(variant_error)) + return Ok(Error::Scheduler(variant_error)); } if pallet_name == "Utility" { let variant_error = utility::Error::decode_with_metadata(cursor, 524u32, metadata)?; - return Ok(Error::Utility(variant_error)) + return Ok(Error::Utility(variant_error)); } if pallet_name == "Preimage" { let variant_error = preimage::Error::decode_with_metadata(cursor, 530u32, metadata)?; - return Ok(Error::Preimage(variant_error)) + return Ok(Error::Preimage(variant_error)); } if pallet_name == "Proxy" { let variant_error = proxy::Error::decode_with_metadata(cursor, 539u32, metadata)?; - return Ok(Error::Proxy(variant_error)) + return Ok(Error::Proxy(variant_error)); } if pallet_name == "XcmpQueue" { let variant_error = xcmp_queue::Error::decode_with_metadata(cursor, 553u32, metadata)?; - return Ok(Error::XcmpQueue(variant_error)) + return Ok(Error::XcmpQueue(variant_error)); } if pallet_name == "PolkadotXcm" { let variant_error = polkadot_xcm::Error::decode_with_metadata(cursor, 574u32, metadata)?; - return Ok(Error::PolkadotXcm(variant_error)) + return Ok(Error::PolkadotXcm(variant_error)); } if pallet_name == "CumulusXcm" { let variant_error = cumulus_xcm::Error::decode_with_metadata(cursor, 575u32, metadata)?; - return Ok(Error::CumulusXcm(variant_error)) + return Ok(Error::CumulusXcm(variant_error)); } if pallet_name == "DmpQueue" { let variant_error = dmp_queue::Error::decode_with_metadata(cursor, 580u32, metadata)?; - return Ok(Error::DmpQueue(variant_error)) + return Ok(Error::DmpQueue(variant_error)); } if pallet_name == "XTokens" { let variant_error = x_tokens::Error::decode_with_metadata(cursor, 581u32, metadata)?; - return Ok(Error::XTokens(variant_error)) + return Ok(Error::XTokens(variant_error)); } if pallet_name == "UnknownTokens" { let variant_error = unknown_tokens::Error::decode_with_metadata(cursor, 584u32, metadata)?; - return Ok(Error::UnknownTokens(variant_error)) + return Ok(Error::UnknownTokens(variant_error)); } if pallet_name == "Tokens" { let variant_error = tokens::Error::decode_with_metadata(cursor, 593u32, metadata)?; - return Ok(Error::Tokens(variant_error)) + return Ok(Error::Tokens(variant_error)); } if pallet_name == "CrowdloanRewards" { let variant_error = crowdloan_rewards::Error::decode_with_metadata(cursor, 595u32, metadata)?; - return Ok(Error::CrowdloanRewards(variant_error)) + return Ok(Error::CrowdloanRewards(variant_error)); } if pallet_name == "Vesting" { let variant_error = vesting::Error::decode_with_metadata(cursor, 600u32, metadata)?; - return Ok(Error::Vesting(variant_error)) + return Ok(Error::Vesting(variant_error)); } if pallet_name == "Assets" { let variant_error = assets::Error::decode_with_metadata(cursor, 601u32, metadata)?; - return Ok(Error::Assets(variant_error)) + return Ok(Error::Assets(variant_error)); } if pallet_name == "AssetsRegistry" { let variant_error = assets_registry::Error::decode_with_metadata(cursor, 603u32, metadata)?; - return Ok(Error::AssetsRegistry(variant_error)) + return Ok(Error::AssetsRegistry(variant_error)); } if pallet_name == "Pablo" { let variant_error = pablo::Error::decode_with_metadata(cursor, 610u32, metadata)?; - return Ok(Error::Pablo(variant_error)) + return Ok(Error::Pablo(variant_error)); } if pallet_name == "Oracle" { let variant_error = oracle::Error::decode_with_metadata(cursor, 620u32, metadata)?; - return Ok(Error::Oracle(variant_error)) + return Ok(Error::Oracle(variant_error)); } if pallet_name == "FarmingRewards" { let variant_error = farming_rewards::Error::decode_with_metadata(cursor, 626u32, metadata)?; - return Ok(Error::FarmingRewards(variant_error)) + return Ok(Error::FarmingRewards(variant_error)); } if pallet_name == "Farming" { let variant_error = farming::Error::decode_with_metadata(cursor, 628u32, metadata)?; - return Ok(Error::Farming(variant_error)) + return Ok(Error::Farming(variant_error)); } if pallet_name == "Referenda" { let variant_error = referenda::Error::decode_with_metadata(cursor, 646u32, metadata)?; - return Ok(Error::Referenda(variant_error)) + return Ok(Error::Referenda(variant_error)); } if pallet_name == "ConvictionVoting" { let variant_error = conviction_voting::Error::decode_with_metadata(cursor, 659u32, metadata)?; - return Ok(Error::ConvictionVoting(variant_error)) + return Ok(Error::ConvictionVoting(variant_error)); } if pallet_name == "Whitelist" { let variant_error = whitelist::Error::decode_with_metadata(cursor, 660u32, metadata)?; - return Ok(Error::Whitelist(variant_error)) + return Ok(Error::Whitelist(variant_error)); } if pallet_name == "CallFilter" { let variant_error = call_filter::Error::decode_with_metadata(cursor, 661u32, metadata)?; - return Ok(Error::CallFilter(variant_error)) + return Ok(Error::CallFilter(variant_error)); } if pallet_name == "Cosmwasm" { let variant_error = cosmwasm::Error::decode_with_metadata(cursor, 665u32, metadata)?; - return Ok(Error::Cosmwasm(variant_error)) + return Ok(Error::Cosmwasm(variant_error)); } if pallet_name == "Ibc" { let variant_error = ibc::Error::decode_with_metadata(cursor, 675u32, metadata)?; - return Ok(Error::Ibc(variant_error)) + return Ok(Error::Ibc(variant_error)); } if pallet_name == "PalletMultihopXcmIbc" { let variant_error = pallet_multihop_xcm_ibc::Error::decode_with_metadata(cursor, 676u32, metadata)?; - return Ok(Error::PalletMultihopXcmIbc(variant_error)) + return Ok(Error::PalletMultihopXcmIbc(variant_error)); } if pallet_name == "PalletXcmHelper" { let variant_error = pallet_xcm_helper::Error::decode_with_metadata(cursor, 677u32, metadata)?; - return Ok(Error::PalletXcmHelper(variant_error)) + return Ok(Error::PalletXcmHelper(variant_error)); } if pallet_name == "PalletLiquidStaking" { let variant_error = pallet_liquid_staking::Error::decode_with_metadata(cursor, 683u32, metadata)?; - return Ok(Error::PalletLiquidStaking(variant_error)) + return Ok(Error::PalletLiquidStaking(variant_error)); } if pallet_name == "RevenueIbc" { let variant_error = revenue_ibc::Error::decode_with_metadata(cursor, 684u32, metadata)?; - return Ok(Error::RevenueIbc(variant_error)) + return Ok(Error::RevenueIbc(variant_error)); } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Error enum", diff --git a/utils/subxt/generated/src/picasso_kusama/relaychain.rs b/utils/subxt/generated/src/picasso_kusama/relaychain.rs index 8dbd36d88..f5db4ebe8 100644 --- a/utils/subxt/generated/src/picasso_kusama/relaychain.rs +++ b/utils/subxt/generated/src/picasso_kusama/relaychain.rs @@ -184,21 +184,21 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Indices" { return Ok(Event::Indices(indices::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Balances" { return Ok(Event::Balances(balances::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "TransactionPayment" { return Ok(Event::TransactionPayment( @@ -207,63 +207,63 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Staking" { return Ok(Event::Staking(staking::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Offences" { return Ok(Event::Offences(offences::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Session" { return Ok(Event::Session(session::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Grandpa" { return Ok(Event::Grandpa(grandpa::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ImOnline" { return Ok(Event::ImOnline(im_online::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Treasury" { return Ok(Event::Treasury(treasury::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ConvictionVoting" { return Ok(Event::ConvictionVoting(conviction_voting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Referenda" { return Ok(Event::Referenda(referenda::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "FellowshipCollective" { return Ok(Event::FellowshipCollective( @@ -272,7 +272,7 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "FellowshipReferenda" { return Ok(Event::FellowshipReferenda( @@ -281,98 +281,98 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Whitelist" { return Ok(Event::Whitelist(whitelist::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Claims" { return Ok(Event::Claims(claims::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Utility" { return Ok(Event::Utility(utility::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Identity" { return Ok(Event::Identity(identity::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Society" { return Ok(Event::Society(society::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Recovery" { return Ok(Event::Recovery(recovery::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Vesting" { return Ok(Event::Vesting(vesting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Scheduler" { return Ok(Event::Scheduler(scheduler::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Proxy" { return Ok(Event::Proxy(proxy::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Multisig" { return Ok(Event::Multisig(multisig::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Preimage" { return Ok(Event::Preimage(preimage::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Bounties" { return Ok(Event::Bounties(bounties::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ChildBounties" { return Ok(Event::ChildBounties(child_bounties::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ElectionProviderMultiPhase" { return Ok(Event::ElectionProviderMultiPhase( @@ -381,14 +381,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Nis" { return Ok(Event::Nis(nis::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "NisCounterpartBalances" { return Ok(Event::NisCounterpartBalances( @@ -397,84 +397,84 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "VoterList" { return Ok(Event::VoterList(voter_list::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "NominationPools" { return Ok(Event::NominationPools(nomination_pools::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "FastUnstake" { return Ok(Event::FastUnstake(fast_unstake::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParaInclusion" { return Ok(Event::ParaInclusion(para_inclusion::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Paras" { return Ok(Event::Paras(paras::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Hrmp" { return Ok(Event::Hrmp(hrmp::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParasDisputes" { return Ok(Event::ParasDisputes(paras_disputes::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Registrar" { return Ok(Event::Registrar(registrar::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Slots" { return Ok(Event::Slots(slots::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Auctions" { return Ok(Event::Auctions(auctions::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Crowdloan" { return Ok(Event::Crowdloan(crowdloan::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "StateTrieMigration" { return Ok(Event::StateTrieMigration( @@ -483,21 +483,21 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "XcmPallet" { return Ok(Event::XcmPallet(xcm_pallet::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "MessageQueue" { return Ok(Event::MessageQueue(message_queue::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Event enum", @@ -631,91 +631,91 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Babe" { return Ok(Call::Babe(babe::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Timestamp" { return Ok(Call::Timestamp(timestamp::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Indices" { return Ok(Call::Indices(indices::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Balances" { return Ok(Call::Balances(balances::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Staking" { return Ok(Call::Staking(staking::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Beefy" { return Ok(Call::Beefy(beefy::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Session" { return Ok(Call::Session(session::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Grandpa" { return Ok(Call::Grandpa(grandpa::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ImOnline" { return Ok(Call::ImOnline(im_online::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Treasury" { return Ok(Call::Treasury(treasury::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ConvictionVoting" { return Ok(Call::ConvictionVoting(conviction_voting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Referenda" { return Ok(Call::Referenda(referenda::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "FellowshipCollective" { return Ok(Call::FellowshipCollective( @@ -724,7 +724,7 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "FellowshipReferenda" { return Ok(Call::FellowshipReferenda( @@ -733,98 +733,98 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Whitelist" { return Ok(Call::Whitelist(whitelist::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Claims" { return Ok(Call::Claims(claims::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Utility" { return Ok(Call::Utility(utility::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Identity" { return Ok(Call::Identity(identity::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Society" { return Ok(Call::Society(society::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Recovery" { return Ok(Call::Recovery(recovery::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Vesting" { return Ok(Call::Vesting(vesting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Scheduler" { return Ok(Call::Scheduler(scheduler::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Proxy" { return Ok(Call::Proxy(proxy::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Multisig" { return Ok(Call::Multisig(multisig::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Preimage" { return Ok(Call::Preimage(preimage::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Bounties" { return Ok(Call::Bounties(bounties::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ChildBounties" { return Ok(Call::ChildBounties(child_bounties::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ElectionProviderMultiPhase" { return Ok(Call::ElectionProviderMultiPhase( @@ -833,14 +833,14 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "Nis" { return Ok(Call::Nis(nis::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "NisCounterpartBalances" { return Ok(Call::NisCounterpartBalances( @@ -849,119 +849,119 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "VoterList" { return Ok(Call::VoterList(voter_list::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "NominationPools" { return Ok(Call::NominationPools(nomination_pools::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "FastUnstake" { return Ok(Call::FastUnstake(fast_unstake::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Configuration" { return Ok(Call::Configuration(configuration::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParasShared" { return Ok(Call::ParasShared(paras_shared::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParaInclusion" { return Ok(Call::ParaInclusion(para_inclusion::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParaInherent" { return Ok(Call::ParaInherent(para_inherent::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Paras" { return Ok(Call::Paras(paras::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Initializer" { return Ok(Call::Initializer(initializer::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Hrmp" { return Ok(Call::Hrmp(hrmp::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParasDisputes" { return Ok(Call::ParasDisputes(paras_disputes::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "ParasSlashing" { return Ok(Call::ParasSlashing(paras_slashing::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Registrar" { return Ok(Call::Registrar(registrar::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Slots" { return Ok(Call::Slots(slots::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Auctions" { return Ok(Call::Auctions(auctions::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "Crowdloan" { return Ok(Call::Crowdloan(crowdloan::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "StateTrieMigration" { return Ok(Call::StateTrieMigration( @@ -970,21 +970,21 @@ pub mod api { pallet_ty, metadata, )?, - )) + )); } if pallet_name == "XcmPallet" { return Ok(Call::XcmPallet(xcm_pallet::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } if pallet_name == "MessageQueue" { return Ok(Call::MessageQueue(message_queue::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)) + )?)); } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Call enum", @@ -1109,224 +1109,224 @@ pub mod api { let cursor = &mut &pallet_bytes[..]; if pallet_name == "System" { let variant_error = system::Error::decode_with_metadata(cursor, 528u32, metadata)?; - return Ok(Error::System(variant_error)) + return Ok(Error::System(variant_error)); } if pallet_name == "Babe" { let variant_error = babe::Error::decode_with_metadata(cursor, 544u32, metadata)?; - return Ok(Error::Babe(variant_error)) + return Ok(Error::Babe(variant_error)); } if pallet_name == "Indices" { let variant_error = indices::Error::decode_with_metadata(cursor, 546u32, metadata)?; - return Ok(Error::Indices(variant_error)) + return Ok(Error::Indices(variant_error)); } if pallet_name == "Balances" { let variant_error = balances::Error::decode_with_metadata(cursor, 562u32, metadata)?; - return Ok(Error::Balances(variant_error)) + return Ok(Error::Balances(variant_error)); } if pallet_name == "Staking" { let variant_error = staking::Error::decode_with_metadata(cursor, 586u32, metadata)?; - return Ok(Error::Staking(variant_error)) + return Ok(Error::Staking(variant_error)); } if pallet_name == "Beefy" { let variant_error = beefy::Error::decode_with_metadata(cursor, 591u32, metadata)?; - return Ok(Error::Beefy(variant_error)) + return Ok(Error::Beefy(variant_error)); } if pallet_name == "Session" { let variant_error = session::Error::decode_with_metadata(cursor, 597u32, metadata)?; - return Ok(Error::Session(variant_error)) + return Ok(Error::Session(variant_error)); } if pallet_name == "Grandpa" { let variant_error = grandpa::Error::decode_with_metadata(cursor, 601u32, metadata)?; - return Ok(Error::Grandpa(variant_error)) + return Ok(Error::Grandpa(variant_error)); } if pallet_name == "ImOnline" { let variant_error = im_online::Error::decode_with_metadata(cursor, 604u32, metadata)?; - return Ok(Error::ImOnline(variant_error)) + return Ok(Error::ImOnline(variant_error)); } if pallet_name == "Treasury" { let variant_error = treasury::Error::decode_with_metadata(cursor, 610u32, metadata)?; - return Ok(Error::Treasury(variant_error)) + return Ok(Error::Treasury(variant_error)); } if pallet_name == "ConvictionVoting" { let variant_error = conviction_voting::Error::decode_with_metadata(cursor, 623u32, metadata)?; - return Ok(Error::ConvictionVoting(variant_error)) + return Ok(Error::ConvictionVoting(variant_error)); } if pallet_name == "Referenda" { let variant_error = referenda::Error::decode_with_metadata(cursor, 641u32, metadata)?; - return Ok(Error::Referenda(variant_error)) + return Ok(Error::Referenda(variant_error)); } if pallet_name == "FellowshipCollective" { let variant_error = fellowship_collective::Error::decode_with_metadata(cursor, 646u32, metadata)?; - return Ok(Error::FellowshipCollective(variant_error)) + return Ok(Error::FellowshipCollective(variant_error)); } if pallet_name == "FellowshipReferenda" { let variant_error = fellowship_referenda::Error::decode_with_metadata(cursor, 650u32, metadata)?; - return Ok(Error::FellowshipReferenda(variant_error)) + return Ok(Error::FellowshipReferenda(variant_error)); } if pallet_name == "Whitelist" { let variant_error = whitelist::Error::decode_with_metadata(cursor, 651u32, metadata)?; - return Ok(Error::Whitelist(variant_error)) + return Ok(Error::Whitelist(variant_error)); } if pallet_name == "Claims" { let variant_error = claims::Error::decode_with_metadata(cursor, 652u32, metadata)?; - return Ok(Error::Claims(variant_error)) + return Ok(Error::Claims(variant_error)); } if pallet_name == "Utility" { let variant_error = utility::Error::decode_with_metadata(cursor, 653u32, metadata)?; - return Ok(Error::Utility(variant_error)) + return Ok(Error::Utility(variant_error)); } if pallet_name == "Identity" { let variant_error = identity::Error::decode_with_metadata(cursor, 664u32, metadata)?; - return Ok(Error::Identity(variant_error)) + return Ok(Error::Identity(variant_error)); } if pallet_name == "Society" { let variant_error = society::Error::decode_with_metadata(cursor, 681u32, metadata)?; - return Ok(Error::Society(variant_error)) + return Ok(Error::Society(variant_error)); } if pallet_name == "Recovery" { let variant_error = recovery::Error::decode_with_metadata(cursor, 685u32, metadata)?; - return Ok(Error::Recovery(variant_error)) + return Ok(Error::Recovery(variant_error)); } if pallet_name == "Vesting" { let variant_error = vesting::Error::decode_with_metadata(cursor, 689u32, metadata)?; - return Ok(Error::Vesting(variant_error)) + return Ok(Error::Vesting(variant_error)); } if pallet_name == "Scheduler" { let variant_error = scheduler::Error::decode_with_metadata(cursor, 694u32, metadata)?; - return Ok(Error::Scheduler(variant_error)) + return Ok(Error::Scheduler(variant_error)); } if pallet_name == "Proxy" { let variant_error = proxy::Error::decode_with_metadata(cursor, 703u32, metadata)?; - return Ok(Error::Proxy(variant_error)) + return Ok(Error::Proxy(variant_error)); } if pallet_name == "Multisig" { let variant_error = multisig::Error::decode_with_metadata(cursor, 707u32, metadata)?; - return Ok(Error::Multisig(variant_error)) + return Ok(Error::Multisig(variant_error)); } if pallet_name == "Preimage" { let variant_error = preimage::Error::decode_with_metadata(cursor, 712u32, metadata)?; - return Ok(Error::Preimage(variant_error)) + return Ok(Error::Preimage(variant_error)); } if pallet_name == "Bounties" { let variant_error = bounties::Error::decode_with_metadata(cursor, 716u32, metadata)?; - return Ok(Error::Bounties(variant_error)) + return Ok(Error::Bounties(variant_error)); } if pallet_name == "ChildBounties" { let variant_error = child_bounties::Error::decode_with_metadata(cursor, 719u32, metadata)?; - return Ok(Error::ChildBounties(variant_error)) + return Ok(Error::ChildBounties(variant_error)); } if pallet_name == "ElectionProviderMultiPhase" { let variant_error = election_provider_multi_phase::Error::decode_with_metadata( cursor, 729u32, metadata, )?; - return Ok(Error::ElectionProviderMultiPhase(variant_error)) + return Ok(Error::ElectionProviderMultiPhase(variant_error)); } if pallet_name == "Nis" { let variant_error = nis::Error::decode_with_metadata(cursor, 737u32, metadata)?; - return Ok(Error::Nis(variant_error)) + return Ok(Error::Nis(variant_error)); } if pallet_name == "NisCounterpartBalances" { let variant_error = nis_counterpart_balances::Error::decode_with_metadata( cursor, 742u32, metadata, )?; - return Ok(Error::NisCounterpartBalances(variant_error)) + return Ok(Error::NisCounterpartBalances(variant_error)); } if pallet_name == "VoterList" { let variant_error = voter_list::Error::decode_with_metadata(cursor, 746u32, metadata)?; - return Ok(Error::VoterList(variant_error)) + return Ok(Error::VoterList(variant_error)); } if pallet_name == "NominationPools" { let variant_error = nomination_pools::Error::decode_with_metadata(cursor, 764u32, metadata)?; - return Ok(Error::NominationPools(variant_error)) + return Ok(Error::NominationPools(variant_error)); } if pallet_name == "FastUnstake" { let variant_error = fast_unstake::Error::decode_with_metadata(cursor, 769u32, metadata)?; - return Ok(Error::FastUnstake(variant_error)) + return Ok(Error::FastUnstake(variant_error)); } if pallet_name == "Configuration" { let variant_error = configuration::Error::decode_with_metadata(cursor, 773u32, metadata)?; - return Ok(Error::Configuration(variant_error)) + return Ok(Error::Configuration(variant_error)); } if pallet_name == "ParaInclusion" { let variant_error = para_inclusion::Error::decode_with_metadata(cursor, 781u32, metadata)?; - return Ok(Error::ParaInclusion(variant_error)) + return Ok(Error::ParaInclusion(variant_error)); } if pallet_name == "ParaInherent" { let variant_error = para_inherent::Error::decode_with_metadata(cursor, 787u32, metadata)?; - return Ok(Error::ParaInherent(variant_error)) + return Ok(Error::ParaInherent(variant_error)); } if pallet_name == "Paras" { let variant_error = paras::Error::decode_with_metadata(cursor, 812u32, metadata)?; - return Ok(Error::Paras(variant_error)) + return Ok(Error::Paras(variant_error)); } if pallet_name == "Hrmp" { let variant_error = hrmp::Error::decode_with_metadata(cursor, 824u32, metadata)?; - return Ok(Error::Hrmp(variant_error)) + return Ok(Error::Hrmp(variant_error)); } if pallet_name == "ParasDisputes" { let variant_error = paras_disputes::Error::decode_with_metadata(cursor, 833u32, metadata)?; - return Ok(Error::ParasDisputes(variant_error)) + return Ok(Error::ParasDisputes(variant_error)); } if pallet_name == "ParasSlashing" { let variant_error = paras_slashing::Error::decode_with_metadata(cursor, 838u32, metadata)?; - return Ok(Error::ParasSlashing(variant_error)) + return Ok(Error::ParasSlashing(variant_error)); } if pallet_name == "Registrar" { let variant_error = registrar::Error::decode_with_metadata(cursor, 841u32, metadata)?; - return Ok(Error::Registrar(variant_error)) + return Ok(Error::Registrar(variant_error)); } if pallet_name == "Slots" { let variant_error = slots::Error::decode_with_metadata(cursor, 843u32, metadata)?; - return Ok(Error::Slots(variant_error)) + return Ok(Error::Slots(variant_error)); } if pallet_name == "Auctions" { let variant_error = auctions::Error::decode_with_metadata(cursor, 848u32, metadata)?; - return Ok(Error::Auctions(variant_error)) + return Ok(Error::Auctions(variant_error)); } if pallet_name == "Crowdloan" { let variant_error = crowdloan::Error::decode_with_metadata(cursor, 851u32, metadata)?; - return Ok(Error::Crowdloan(variant_error)) + return Ok(Error::Crowdloan(variant_error)); } if pallet_name == "StateTrieMigration" { let variant_error = state_trie_migration::Error::decode_with_metadata(cursor, 508u32, metadata)?; - return Ok(Error::StateTrieMigration(variant_error)) + return Ok(Error::StateTrieMigration(variant_error)); } if pallet_name == "XcmPallet" { let variant_error = xcm_pallet::Error::decode_with_metadata(cursor, 873u32, metadata)?; - return Ok(Error::XcmPallet(variant_error)) + return Ok(Error::XcmPallet(variant_error)); } if pallet_name == "MessageQueue" { let variant_error = message_queue::Error::decode_with_metadata(cursor, 880u32, metadata)?; - return Ok(Error::MessageQueue(variant_error)) + return Ok(Error::MessageQueue(variant_error)); } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Error enum", From f69a5371e09a46846d60888e2d12437f050bd022 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Tue, 19 Dec 2023 12:20:50 -0300 Subject: [PATCH 03/22] Revert "subxt update (#462)" This reverts commit 687ff2f5989ebb1ad37e054b9bb198baeadc9f6b. --- utils/subxt/generated/src/composable/parachain.rs | 2 +- utils/subxt/generated/src/picasso_kusama/parachain.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/subxt/generated/src/composable/parachain.rs b/utils/subxt/generated/src/composable/parachain.rs index c75eba666..769a8eee9 100644 --- a/utils/subxt/generated/src/composable/parachain.rs +++ b/utils/subxt/generated/src/composable/parachain.rs @@ -31585,7 +31585,7 @@ pub mod api { module_id: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 24)] - PushWasmCode { wasm_code_id: ::std::vec::Vec<::core::primitive::u8> }, + PushWasmCode { wasm_checksum: ::std::vec::Vec<::core::primitive::u8> }, } } pub mod ics20_fee { diff --git a/utils/subxt/generated/src/picasso_kusama/parachain.rs b/utils/subxt/generated/src/picasso_kusama/parachain.rs index 1e62a349c..a349e0bac 100644 --- a/utils/subxt/generated/src/picasso_kusama/parachain.rs +++ b/utils/subxt/generated/src/picasso_kusama/parachain.rs @@ -35933,7 +35933,7 @@ pub mod api { module_id: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 24)] - PushWasmCode { wasm_code_id: ::std::vec::Vec<::core::primitive::u8> }, + PushWasmCode { wasm_checksum: ::std::vec::Vec<::core::primitive::u8> }, } } pub mod ics20_fee { From 81191742c6e230c21522aca4f93f3a085faf73b8 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Tue, 19 Dec 2023 14:08:42 -0300 Subject: [PATCH 04/22] Primitive packet trace Allows to check the current status of the packet --- Cargo.lock | 1 + contracts/pallet-ibc/rpc/Cargo.toml | 1 + contracts/pallet-ibc/rpc/src/lib.rs | 8 ++ hyperspace/core/src/command.rs | 126 ++++++++++++++++++++++++++-- hyperspace/cosmos/src/client.rs | 8 +- hyperspace/src/main.rs | 5 ++ 6 files changed, 140 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e4cbdedcf..0eeb254de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4994,6 +4994,7 @@ name = "ibc-rpc" version = "0.1.0" dependencies = [ "frame-system", + "hex", "ibc", "ibc-derive", "ibc-primitives 0.1.0", diff --git a/contracts/pallet-ibc/rpc/Cargo.toml b/contracts/pallet-ibc/rpc/Cargo.toml index 6eb4d9314..8e5a2c606 100644 --- a/contracts/pallet-ibc/rpc/Cargo.toml +++ b/contracts/pallet-ibc/rpc/Cargo.toml @@ -27,6 +27,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot- sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false } +hex = "0.4.3" [dependencies.ibc] path = "../../../ibc/modules" diff --git a/contracts/pallet-ibc/rpc/src/lib.rs b/contracts/pallet-ibc/rpc/src/lib.rs index 81ba81caa..3dc90ede3 100644 --- a/contracts/pallet-ibc/rpc/src/lib.rs +++ b/contracts/pallet-ibc/rpc/src/lib.rs @@ -136,6 +136,14 @@ pub struct PacketInfo { pub ack: Option>, } +impl Display for PacketInfo { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "PacketInfo {{ height: {}, seq: {}, src_chan: {}/{}, dst_chan: {}/{}, data: {}, timeout_height: {}-{}, timeout_timestamp: {}, ack: {} }}", + self.height.unwrap_or(0), self.sequence, self.source_port, self.source_channel, self.destination_port, self.destination_channel, + String::from_utf8(self.data.clone()).unwrap_or_else(|_| hex::encode(&self.data)), self.timeout_height.revision_number, self.timeout_height.revision_height, self.timeout_timestamp, self.ack.clone().map(|ack| String::from_utf8(ack.clone()).unwrap_or_else(|_| hex::encode(&ack))).unwrap_or_default()) + } +} + impl TryFrom for PacketInfo { type Error = (); diff --git a/hyperspace/core/src/command.rs b/hyperspace/core/src/command.rs index cea44bfcc..98f209ec8 100644 --- a/hyperspace/core/src/command.rs +++ b/hyperspace/core/src/command.rs @@ -13,14 +13,18 @@ // limitations under the License. use crate::{ - chain::{AnyConfig, Config, CoreConfig}, + chain::{AnyChain, AnyConfig, Config, CoreConfig}, fish, relay, Mode, }; use anyhow::{anyhow, Result}; use clap::{Args, Parser}; -use ibc::core::{ics04_channel::channel::Order, ics24_host::identifier::PortId}; +use ibc::core::{ + ics04_channel::channel::{ChannelEnd, Order}, + ics24_host::identifier::PortId, +}; use metrics::{data::Metrics, handler::MetricsHandler, init_prometheus}; use primitives::{ + error::Error, utils::{create_channel, create_clients, create_connection}, Chain, IbcProvider, }; @@ -52,9 +56,9 @@ pub enum Subcommand { #[clap(name = "create-channel", about = "Creates a channel on the specified port")] CreateChannel(Cmd), #[clap(name = "query", about = "Query commands")] - Client { + Query { #[command(subcommand)] - client: QueryCmd, + query: QueryCmd, #[command(flatten)] cmd: Cmd, }, @@ -126,7 +130,7 @@ impl UploadWasmCmd { } impl Cmd { - async fn parse_config(&self) -> Result { + pub async fn parse_config(&self) -> Result { use tokio::fs::read_to_string; let path_a: PathBuf = self.config_a.parse()?; let path_b: PathBuf = self.config_b.parse()?; @@ -289,12 +293,124 @@ pub enum QueryCmd { Packets(QueryPacketsCmd), } +impl QueryCmd { + pub async fn run(&self, config: Config) -> anyhow::Result<()> { + let chain_a = config.chain_a.into_client().await?; + let chain_b = config.chain_b.into_client().await?; + + match self { + QueryCmd::Packets(query) => query.run(chain_a, chain_b).await, + } + } +} + #[derive(Debug, Clone, clap::Subcommand)] pub enum QueryPacketsCmd { /// Trace packets Trace(TracePacketsCmd), } +impl QueryPacketsCmd { + pub(crate) async fn run(&self, chain_a: AnyChain, chain_b: AnyChain) -> anyhow::Result<()> { + let name_a = chain_a.name(); + let name_b = chain_b.name(); + let (height_a, _) = chain_a.latest_height_and_timestamp().await?; + let (_height_b, _) = chain_b.latest_height_and_timestamp().await?; + + match self { + QueryPacketsCmd::Trace(cmd) => { + let sequence = cmd.sequence; + let set = chain_a.channel_whitelist(); + if set.is_empty() { + println!("No channels found on {name_a}"); + return Ok(()) + } + for (channel_id, port_id) in set { + let channel_response = + chain_a.query_channel_end(height_a, channel_id, port_id.clone()).await?; + let channel_end = + ChannelEnd::try_from(channel_response.channel.ok_or_else(|| { + Error::Custom("ChannelEnd not could not be decoded".to_string()) + })?) + .map_err(|e| Error::Custom(e.to_string()))?; + let counterparty_channel_id = + channel_end.counterparty().channel_id.ok_or_else(|| { + Error::Custom("Expected counterparty channel id".to_string()) + })?; + let counterparty_port_id = channel_end.counterparty().port_id.clone(); + + let maybe_received = chain_b + .query_received_packets( + counterparty_channel_id.clone(), + counterparty_port_id.clone(), + vec![sequence], + ) + .await? + .pop(); + + if let Some(received) = maybe_received { + println!("Packet {sequence} was received on {name_b}: {received}"); + let unreceived_acks = chain_a + .query_unreceived_acknowledgements( + height_a, + channel_id.clone(), + port_id.clone(), + vec![sequence], + ) + .await?; + if unreceived_acks.is_empty() { + println!("Packet {sequence} was acknowledged on {name_a}"); + } else { + println!("Packet {sequence} was not acknowledged on {name_a}"); + } + continue; + } + let sent_packets = chain_a + .query_send_packets(channel_id.clone(), port_id.clone(), vec![sequence]) + .await?; + if sent_packets.is_empty() { + println!("Packet {sequence} not found"); + continue; + } + for packet_info in sent_packets { + let seq = packet_info.sequence; + println!("Sent packet {} ({name_a}->{name_b}): {}", seq, packet_info); + let received = chain_b + .query_received_packets( + packet_info.destination_channel.parse()?, + packet_info.destination_port.parse()?, + vec![seq], + ) + .await? + .pop(); + if received.is_none() { + println!("Packet {seq} ({name_a}->{name_b}) was not received"); + continue; + } + + println!("Received packet {seq} ({name_a}->{name_b}) {received:?}"); + + let ack = chain_a + .query_unreceived_acknowledgements( + height_a, + channel_id.clone(), + port_id.clone(), + vec![seq], + ) + .await?; + if ack.is_empty() { + println!("Packet {seq} ({name_a}->{name_b}) was acknowledged"); + } else { + println!("Packet {seq} ({name_a}->{name_b}) was not acknowledged"); + } + } + } + Ok(()) + }, + } + } +} + #[derive(Debug, Clone, Args)] pub struct TracePacketsCmd { pub sequence: u64, diff --git a/hyperspace/cosmos/src/client.rs b/hyperspace/cosmos/src/client.rs index c49c7be68..53b4fcbfa 100644 --- a/hyperspace/cosmos/src/client.rs +++ b/hyperspace/cosmos/src/client.rs @@ -253,15 +253,15 @@ where pub async fn new(config: CosmosClientConfig) -> Result { let (rpc_client, rpc_driver) = WebSocketClient::new(config.websocket_url.clone()) .await - .map_err(|e| Error::RpcError(format!("{:?}", e)))?; + .map_err(|e| Error::RpcError(format!("failed to connect to WS: {:?}", e)))?; let rpc_http_client = HttpClient::new(config.rpc_url.clone()) - .map_err(|e| Error::RpcError(format!("{:?}", e)))?; + .map_err(|e| Error::RpcError(format!("failed to connect to RPC: {:?}", e)))?; let ws_driver_jh = tokio::spawn(rpc_driver.run()); let grpc_client = tonic::transport::Endpoint::new(config.grpc_url.to_string()) - .map_err(|e| Error::RpcError(format!("{:?}", e)))? + .map_err(|e| Error::RpcError(format!("failed to connect to GRPC: {:?}", e)))? .connect() .await - .map_err(|e| Error::RpcError(format!("{:?}", e)))?; + .map_err(|e| Error::RpcError(format!("failed to connect to GRPC: {:?}", e)))?; let chain_id = ChainId::from(config.chain_id); let light_client = diff --git a/hyperspace/src/main.rs b/hyperspace/src/main.rs index e09b143e8..2e8b459dd 100644 --- a/hyperspace/src/main.rs +++ b/hyperspace/src/main.rs @@ -42,5 +42,10 @@ async fn main() -> Result<()> { cmd.save_config(&new_config).await }, Subcommand::Fish(cmd) => cmd.fish().await, + Subcommand::Query { cmd, query } => { + let config = cmd.parse_config().await?; + query.run(config).await?; + Ok(()) + }, } } From c06661044832cf02992a19e9ab879c1d0884c366 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Tue, 19 Dec 2023 18:24:56 -0300 Subject: [PATCH 05/22] use a newer image for linters, remove '+nightly' in cargo fmt check --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5ea372c9f..0b2b1c047 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: group: check-${{ github.ref }} cancel-in-progress: true container: - image: paritytech/ci-unified:bullseye-1.71.0-v20230727 + image: paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231214 runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -33,7 +33,7 @@ jobs: run: rustup show - name: Cargo fmt - run: cargo +nightly fmt --all -- --check + run: cargo fmt --all -- --check - uses: actions-rs/cargo@v1 name: "Udeps Installation" From 2254549705a5988cc33cfc02f5b03d0c72bdd536 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Tue, 19 Dec 2023 18:49:10 -0300 Subject: [PATCH 06/22] update lint.yml --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0b2b1c047..d1bdf9834 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,7 +33,7 @@ jobs: run: rustup show - name: Cargo fmt - run: cargo fmt --all -- --check + run: cargo +stable fmt --all -- --check - uses: actions-rs/cargo@v1 name: "Udeps Installation" From cd422e0ef0c29e7d4dddd53e3c9f5ee9c997a071 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Wed, 20 Dec 2023 11:01:59 -0300 Subject: [PATCH 07/22] revert lint.yml --- .github/workflows/lint.yml | 2 +- hyperspace/core/src/command.rs | 6 +- .../generated/src/picasso_kusama/parachain.rs | 292 +++++++++--------- .../src/picasso_kusama/relaychain.rs | 282 ++++++++--------- 4 files changed, 291 insertions(+), 291 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d1bdf9834..b297280c8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,7 +33,7 @@ jobs: run: rustup show - name: Cargo fmt - run: cargo +stable fmt --all -- --check + run: cargo +nightly fmt --all -- --check - uses: actions-rs/cargo@v1 name: "Udeps Installation" diff --git a/hyperspace/core/src/command.rs b/hyperspace/core/src/command.rs index 98f209ec8..d03b59322 100644 --- a/hyperspace/core/src/command.rs +++ b/hyperspace/core/src/command.rs @@ -363,14 +363,14 @@ impl QueryPacketsCmd { } else { println!("Packet {sequence} was not acknowledged on {name_a}"); } - continue; + continue } let sent_packets = chain_a .query_send_packets(channel_id.clone(), port_id.clone(), vec![sequence]) .await?; if sent_packets.is_empty() { println!("Packet {sequence} not found"); - continue; + continue } for packet_info in sent_packets { let seq = packet_info.sequence; @@ -385,7 +385,7 @@ impl QueryPacketsCmd { .pop(); if received.is_none() { println!("Packet {seq} ({name_a}->{name_b}) was not received"); - continue; + continue } println!("Received packet {seq} ({name_a}->{name_b}) {received:?}"); diff --git a/utils/subxt/generated/src/picasso_kusama/parachain.rs b/utils/subxt/generated/src/picasso_kusama/parachain.rs index a349e0bac..36e5bedb6 100644 --- a/utils/subxt/generated/src/picasso_kusama/parachain.rs +++ b/utils/subxt/generated/src/picasso_kusama/parachain.rs @@ -186,14 +186,14 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Sudo" { return Ok(Event::Sudo(sudo::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "TransactionPayment" { return Ok(Event::TransactionPayment( @@ -202,42 +202,42 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Indices" { return Ok(Event::Indices(indices::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Balances" { return Ok(Event::Balances(balances::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Identity" { return Ok(Event::Identity(identity::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Multisig" { return Ok(Event::Multisig(multisig::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParachainSystem" { return Ok(Event::ParachainSystem(parachain_system::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CollatorSelection" { return Ok(Event::CollatorSelection( @@ -246,21 +246,21 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Session" { return Ok(Event::Session(session::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Council" { return Ok(Event::Council(council::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CouncilMembership" { return Ok(Event::CouncilMembership( @@ -269,14 +269,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Treasury" { return Ok(Event::Treasury(treasury::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "TechnicalCommittee" { return Ok(Event::TechnicalCommittee( @@ -285,7 +285,7 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "TechnicalCommitteeMembership" { return Ok(Event::TechnicalCommitteeMembership( @@ -294,14 +294,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "ReleaseCommittee" { return Ok(Event::ReleaseCommittee(release_committee::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ReleaseMembership" { return Ok(Event::ReleaseMembership( @@ -310,14 +310,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "RelayerCommittee" { return Ok(Event::RelayerCommittee(relayer_committee::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "RelayerCommitteeMembership" { return Ok(Event::RelayerCommitteeMembership( @@ -326,182 +326,182 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Scheduler" { return Ok(Event::Scheduler(scheduler::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Utility" { return Ok(Event::Utility(utility::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Preimage" { return Ok(Event::Preimage(preimage::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Proxy" { return Ok(Event::Proxy(proxy::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "XcmpQueue" { return Ok(Event::XcmpQueue(xcmp_queue::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "PolkadotXcm" { return Ok(Event::PolkadotXcm(polkadot_xcm::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CumulusXcm" { return Ok(Event::CumulusXcm(cumulus_xcm::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "DmpQueue" { return Ok(Event::DmpQueue(dmp_queue::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "XTokens" { return Ok(Event::XTokens(x_tokens::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "UnknownTokens" { return Ok(Event::UnknownTokens(unknown_tokens::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Tokens" { return Ok(Event::Tokens(tokens::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CrowdloanRewards" { return Ok(Event::CrowdloanRewards(crowdloan_rewards::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Vesting" { return Ok(Event::Vesting(vesting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "AssetsRegistry" { return Ok(Event::AssetsRegistry(assets_registry::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Pablo" { return Ok(Event::Pablo(pablo::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Oracle" { return Ok(Event::Oracle(oracle::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "FarmingRewards" { return Ok(Event::FarmingRewards(farming_rewards::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Farming" { return Ok(Event::Farming(farming::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Referenda" { return Ok(Event::Referenda(referenda::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ConvictionVoting" { return Ok(Event::ConvictionVoting(conviction_voting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Whitelist" { return Ok(Event::Whitelist(whitelist::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CallFilter" { return Ok(Event::CallFilter(call_filter::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Cosmwasm" { return Ok(Event::Cosmwasm(cosmwasm::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Ibc" { return Ok(Event::Ibc(ibc::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Ics20Fee" { return Ok(Event::Ics20Fee(ics20_fee::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "PalletMultihopXcmIbc" { return Ok(Event::PalletMultihopXcmIbc( @@ -510,14 +510,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "PalletXcmHelper" { return Ok(Event::PalletXcmHelper(pallet_xcm_helper::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "PalletLiquidStaking" { return Ok(Event::PalletLiquidStaking( @@ -526,14 +526,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "RevenueIbc" { return Ok(Event::RevenueIbc(revenue_ibc::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Event enum", @@ -669,105 +669,105 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Timestamp" { return Ok(Call::Timestamp(timestamp::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Sudo" { return Ok(Call::Sudo(sudo::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "AssetTxPayment" { return Ok(Call::AssetTxPayment(asset_tx_payment::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Indices" { return Ok(Call::Indices(indices::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Balances" { return Ok(Call::Balances(balances::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Identity" { return Ok(Call::Identity(identity::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Multisig" { return Ok(Call::Multisig(multisig::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParachainSystem" { return Ok(Call::ParachainSystem(parachain_system::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParachainInfo" { return Ok(Call::ParachainInfo(parachain_info::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CollatorSelection" { return Ok(Call::CollatorSelection(collator_selection::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Session" { return Ok(Call::Session(session::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Council" { return Ok(Call::Council(council::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CouncilMembership" { return Ok(Call::CouncilMembership(council_membership::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Treasury" { return Ok(Call::Treasury(treasury::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "TechnicalCommittee" { return Ok(Call::TechnicalCommittee( @@ -776,7 +776,7 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "TechnicalCommitteeMembership" { return Ok(Call::TechnicalCommitteeMembership( @@ -785,28 +785,28 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "ReleaseCommittee" { return Ok(Call::ReleaseCommittee(release_committee::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ReleaseMembership" { return Ok(Call::ReleaseMembership(release_membership::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "RelayerCommittee" { return Ok(Call::RelayerCommittee(relayer_committee::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "RelayerCommitteeMembership" { return Ok(Call::RelayerCommitteeMembership( @@ -815,189 +815,189 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Scheduler" { return Ok(Call::Scheduler(scheduler::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Utility" { return Ok(Call::Utility(utility::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Preimage" { return Ok(Call::Preimage(preimage::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Proxy" { return Ok(Call::Proxy(proxy::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "XcmpQueue" { return Ok(Call::XcmpQueue(xcmp_queue::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "PolkadotXcm" { return Ok(Call::PolkadotXcm(polkadot_xcm::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CumulusXcm" { return Ok(Call::CumulusXcm(cumulus_xcm::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "DmpQueue" { return Ok(Call::DmpQueue(dmp_queue::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "XTokens" { return Ok(Call::XTokens(x_tokens::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "UnknownTokens" { return Ok(Call::UnknownTokens(unknown_tokens::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Tokens" { return Ok(Call::Tokens(tokens::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CrowdloanRewards" { return Ok(Call::CrowdloanRewards(crowdloan_rewards::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Vesting" { return Ok(Call::Vesting(vesting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Assets" { return Ok(Call::Assets(assets::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "AssetsRegistry" { return Ok(Call::AssetsRegistry(assets_registry::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Pablo" { return Ok(Call::Pablo(pablo::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Oracle" { return Ok(Call::Oracle(oracle::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "FarmingRewards" { return Ok(Call::FarmingRewards(farming_rewards::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Farming" { return Ok(Call::Farming(farming::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Referenda" { return Ok(Call::Referenda(referenda::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ConvictionVoting" { return Ok(Call::ConvictionVoting(conviction_voting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Whitelist" { return Ok(Call::Whitelist(whitelist::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "CallFilter" { return Ok(Call::CallFilter(call_filter::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Cosmwasm" { return Ok(Call::Cosmwasm(cosmwasm::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Ibc" { return Ok(Call::Ibc(ibc::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Ics20Fee" { return Ok(Call::Ics20Fee(ics20_fee::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "PalletMultihopXcmIbc" { return Ok(Call::PalletMultihopXcmIbc( @@ -1006,14 +1006,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "PalletXcmHelper" { return Ok(Call::PalletXcmHelper(pallet_xcm_helper::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "PalletLiquidStaking" { return Ok(Call::PalletLiquidStaking( @@ -1022,14 +1022,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "RevenueIbc" { return Ok(Call::RevenueIbc(revenue_ibc::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Call enum", @@ -1154,226 +1154,226 @@ pub mod api { let cursor = &mut &pallet_bytes[..]; if pallet_name == "System" { let variant_error = system::Error::decode_with_metadata(cursor, 439u32, metadata)?; - return Ok(Error::System(variant_error)); + return Ok(Error::System(variant_error)) } if pallet_name == "Sudo" { let variant_error = sudo::Error::decode_with_metadata(cursor, 440u32, metadata)?; - return Ok(Error::Sudo(variant_error)); + return Ok(Error::Sudo(variant_error)) } if pallet_name == "Indices" { let variant_error = indices::Error::decode_with_metadata(cursor, 443u32, metadata)?; - return Ok(Error::Indices(variant_error)); + return Ok(Error::Indices(variant_error)) } if pallet_name == "Balances" { let variant_error = balances::Error::decode_with_metadata(cursor, 457u32, metadata)?; - return Ok(Error::Balances(variant_error)); + return Ok(Error::Balances(variant_error)) } if pallet_name == "Identity" { let variant_error = identity::Error::decode_with_metadata(cursor, 468u32, metadata)?; - return Ok(Error::Identity(variant_error)); + return Ok(Error::Identity(variant_error)) } if pallet_name == "Multisig" { let variant_error = multisig::Error::decode_with_metadata(cursor, 472u32, metadata)?; - return Ok(Error::Multisig(variant_error)); + return Ok(Error::Multisig(variant_error)) } if pallet_name == "ParachainSystem" { let variant_error = parachain_system::Error::decode_with_metadata(cursor, 488u32, metadata)?; - return Ok(Error::ParachainSystem(variant_error)); + return Ok(Error::ParachainSystem(variant_error)) } if pallet_name == "CollatorSelection" { let variant_error = collator_selection::Error::decode_with_metadata(cursor, 493u32, metadata)?; - return Ok(Error::CollatorSelection(variant_error)); + return Ok(Error::CollatorSelection(variant_error)) } if pallet_name == "Session" { let variant_error = session::Error::decode_with_metadata(cursor, 498u32, metadata)?; - return Ok(Error::Session(variant_error)); + return Ok(Error::Session(variant_error)) } if pallet_name == "Council" { let variant_error = council::Error::decode_with_metadata(cursor, 504u32, metadata)?; - return Ok(Error::Council(variant_error)); + return Ok(Error::Council(variant_error)) } if pallet_name == "CouncilMembership" { let variant_error = council_membership::Error::decode_with_metadata(cursor, 506u32, metadata)?; - return Ok(Error::CouncilMembership(variant_error)); + return Ok(Error::CouncilMembership(variant_error)) } if pallet_name == "Treasury" { let variant_error = treasury::Error::decode_with_metadata(cursor, 510u32, metadata)?; - return Ok(Error::Treasury(variant_error)); + return Ok(Error::Treasury(variant_error)) } if pallet_name == "TechnicalCommittee" { let variant_error = technical_committee::Error::decode_with_metadata(cursor, 511u32, metadata)?; - return Ok(Error::TechnicalCommittee(variant_error)); + return Ok(Error::TechnicalCommittee(variant_error)) } if pallet_name == "TechnicalCommitteeMembership" { let variant_error = technical_committee_membership::Error::decode_with_metadata( cursor, 512u32, metadata, )?; - return Ok(Error::TechnicalCommitteeMembership(variant_error)); + return Ok(Error::TechnicalCommitteeMembership(variant_error)) } if pallet_name == "ReleaseCommittee" { let variant_error = release_committee::Error::decode_with_metadata(cursor, 514u32, metadata)?; - return Ok(Error::ReleaseCommittee(variant_error)); + return Ok(Error::ReleaseCommittee(variant_error)) } if pallet_name == "ReleaseMembership" { let variant_error = release_membership::Error::decode_with_metadata(cursor, 516u32, metadata)?; - return Ok(Error::ReleaseMembership(variant_error)); + return Ok(Error::ReleaseMembership(variant_error)) } if pallet_name == "RelayerCommittee" { let variant_error = relayer_committee::Error::decode_with_metadata(cursor, 517u32, metadata)?; - return Ok(Error::RelayerCommittee(variant_error)); + return Ok(Error::RelayerCommittee(variant_error)) } if pallet_name == "RelayerCommitteeMembership" { let variant_error = relayer_committee_membership::Error::decode_with_metadata( cursor, 518u32, metadata, )?; - return Ok(Error::RelayerCommitteeMembership(variant_error)); + return Ok(Error::RelayerCommitteeMembership(variant_error)) } if pallet_name == "Scheduler" { let variant_error = scheduler::Error::decode_with_metadata(cursor, 523u32, metadata)?; - return Ok(Error::Scheduler(variant_error)); + return Ok(Error::Scheduler(variant_error)) } if pallet_name == "Utility" { let variant_error = utility::Error::decode_with_metadata(cursor, 524u32, metadata)?; - return Ok(Error::Utility(variant_error)); + return Ok(Error::Utility(variant_error)) } if pallet_name == "Preimage" { let variant_error = preimage::Error::decode_with_metadata(cursor, 530u32, metadata)?; - return Ok(Error::Preimage(variant_error)); + return Ok(Error::Preimage(variant_error)) } if pallet_name == "Proxy" { let variant_error = proxy::Error::decode_with_metadata(cursor, 539u32, metadata)?; - return Ok(Error::Proxy(variant_error)); + return Ok(Error::Proxy(variant_error)) } if pallet_name == "XcmpQueue" { let variant_error = xcmp_queue::Error::decode_with_metadata(cursor, 553u32, metadata)?; - return Ok(Error::XcmpQueue(variant_error)); + return Ok(Error::XcmpQueue(variant_error)) } if pallet_name == "PolkadotXcm" { let variant_error = polkadot_xcm::Error::decode_with_metadata(cursor, 574u32, metadata)?; - return Ok(Error::PolkadotXcm(variant_error)); + return Ok(Error::PolkadotXcm(variant_error)) } if pallet_name == "CumulusXcm" { let variant_error = cumulus_xcm::Error::decode_with_metadata(cursor, 575u32, metadata)?; - return Ok(Error::CumulusXcm(variant_error)); + return Ok(Error::CumulusXcm(variant_error)) } if pallet_name == "DmpQueue" { let variant_error = dmp_queue::Error::decode_with_metadata(cursor, 580u32, metadata)?; - return Ok(Error::DmpQueue(variant_error)); + return Ok(Error::DmpQueue(variant_error)) } if pallet_name == "XTokens" { let variant_error = x_tokens::Error::decode_with_metadata(cursor, 581u32, metadata)?; - return Ok(Error::XTokens(variant_error)); + return Ok(Error::XTokens(variant_error)) } if pallet_name == "UnknownTokens" { let variant_error = unknown_tokens::Error::decode_with_metadata(cursor, 584u32, metadata)?; - return Ok(Error::UnknownTokens(variant_error)); + return Ok(Error::UnknownTokens(variant_error)) } if pallet_name == "Tokens" { let variant_error = tokens::Error::decode_with_metadata(cursor, 593u32, metadata)?; - return Ok(Error::Tokens(variant_error)); + return Ok(Error::Tokens(variant_error)) } if pallet_name == "CrowdloanRewards" { let variant_error = crowdloan_rewards::Error::decode_with_metadata(cursor, 595u32, metadata)?; - return Ok(Error::CrowdloanRewards(variant_error)); + return Ok(Error::CrowdloanRewards(variant_error)) } if pallet_name == "Vesting" { let variant_error = vesting::Error::decode_with_metadata(cursor, 600u32, metadata)?; - return Ok(Error::Vesting(variant_error)); + return Ok(Error::Vesting(variant_error)) } if pallet_name == "Assets" { let variant_error = assets::Error::decode_with_metadata(cursor, 601u32, metadata)?; - return Ok(Error::Assets(variant_error)); + return Ok(Error::Assets(variant_error)) } if pallet_name == "AssetsRegistry" { let variant_error = assets_registry::Error::decode_with_metadata(cursor, 603u32, metadata)?; - return Ok(Error::AssetsRegistry(variant_error)); + return Ok(Error::AssetsRegistry(variant_error)) } if pallet_name == "Pablo" { let variant_error = pablo::Error::decode_with_metadata(cursor, 610u32, metadata)?; - return Ok(Error::Pablo(variant_error)); + return Ok(Error::Pablo(variant_error)) } if pallet_name == "Oracle" { let variant_error = oracle::Error::decode_with_metadata(cursor, 620u32, metadata)?; - return Ok(Error::Oracle(variant_error)); + return Ok(Error::Oracle(variant_error)) } if pallet_name == "FarmingRewards" { let variant_error = farming_rewards::Error::decode_with_metadata(cursor, 626u32, metadata)?; - return Ok(Error::FarmingRewards(variant_error)); + return Ok(Error::FarmingRewards(variant_error)) } if pallet_name == "Farming" { let variant_error = farming::Error::decode_with_metadata(cursor, 628u32, metadata)?; - return Ok(Error::Farming(variant_error)); + return Ok(Error::Farming(variant_error)) } if pallet_name == "Referenda" { let variant_error = referenda::Error::decode_with_metadata(cursor, 646u32, metadata)?; - return Ok(Error::Referenda(variant_error)); + return Ok(Error::Referenda(variant_error)) } if pallet_name == "ConvictionVoting" { let variant_error = conviction_voting::Error::decode_with_metadata(cursor, 659u32, metadata)?; - return Ok(Error::ConvictionVoting(variant_error)); + return Ok(Error::ConvictionVoting(variant_error)) } if pallet_name == "Whitelist" { let variant_error = whitelist::Error::decode_with_metadata(cursor, 660u32, metadata)?; - return Ok(Error::Whitelist(variant_error)); + return Ok(Error::Whitelist(variant_error)) } if pallet_name == "CallFilter" { let variant_error = call_filter::Error::decode_with_metadata(cursor, 661u32, metadata)?; - return Ok(Error::CallFilter(variant_error)); + return Ok(Error::CallFilter(variant_error)) } if pallet_name == "Cosmwasm" { let variant_error = cosmwasm::Error::decode_with_metadata(cursor, 665u32, metadata)?; - return Ok(Error::Cosmwasm(variant_error)); + return Ok(Error::Cosmwasm(variant_error)) } if pallet_name == "Ibc" { let variant_error = ibc::Error::decode_with_metadata(cursor, 675u32, metadata)?; - return Ok(Error::Ibc(variant_error)); + return Ok(Error::Ibc(variant_error)) } if pallet_name == "PalletMultihopXcmIbc" { let variant_error = pallet_multihop_xcm_ibc::Error::decode_with_metadata(cursor, 676u32, metadata)?; - return Ok(Error::PalletMultihopXcmIbc(variant_error)); + return Ok(Error::PalletMultihopXcmIbc(variant_error)) } if pallet_name == "PalletXcmHelper" { let variant_error = pallet_xcm_helper::Error::decode_with_metadata(cursor, 677u32, metadata)?; - return Ok(Error::PalletXcmHelper(variant_error)); + return Ok(Error::PalletXcmHelper(variant_error)) } if pallet_name == "PalletLiquidStaking" { let variant_error = pallet_liquid_staking::Error::decode_with_metadata(cursor, 683u32, metadata)?; - return Ok(Error::PalletLiquidStaking(variant_error)); + return Ok(Error::PalletLiquidStaking(variant_error)) } if pallet_name == "RevenueIbc" { let variant_error = revenue_ibc::Error::decode_with_metadata(cursor, 684u32, metadata)?; - return Ok(Error::RevenueIbc(variant_error)); + return Ok(Error::RevenueIbc(variant_error)) } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Error enum", diff --git a/utils/subxt/generated/src/picasso_kusama/relaychain.rs b/utils/subxt/generated/src/picasso_kusama/relaychain.rs index f5db4ebe8..8dbd36d88 100644 --- a/utils/subxt/generated/src/picasso_kusama/relaychain.rs +++ b/utils/subxt/generated/src/picasso_kusama/relaychain.rs @@ -184,21 +184,21 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Indices" { return Ok(Event::Indices(indices::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Balances" { return Ok(Event::Balances(balances::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "TransactionPayment" { return Ok(Event::TransactionPayment( @@ -207,63 +207,63 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Staking" { return Ok(Event::Staking(staking::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Offences" { return Ok(Event::Offences(offences::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Session" { return Ok(Event::Session(session::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Grandpa" { return Ok(Event::Grandpa(grandpa::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ImOnline" { return Ok(Event::ImOnline(im_online::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Treasury" { return Ok(Event::Treasury(treasury::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ConvictionVoting" { return Ok(Event::ConvictionVoting(conviction_voting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Referenda" { return Ok(Event::Referenda(referenda::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "FellowshipCollective" { return Ok(Event::FellowshipCollective( @@ -272,7 +272,7 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "FellowshipReferenda" { return Ok(Event::FellowshipReferenda( @@ -281,98 +281,98 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Whitelist" { return Ok(Event::Whitelist(whitelist::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Claims" { return Ok(Event::Claims(claims::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Utility" { return Ok(Event::Utility(utility::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Identity" { return Ok(Event::Identity(identity::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Society" { return Ok(Event::Society(society::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Recovery" { return Ok(Event::Recovery(recovery::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Vesting" { return Ok(Event::Vesting(vesting::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Scheduler" { return Ok(Event::Scheduler(scheduler::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Proxy" { return Ok(Event::Proxy(proxy::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Multisig" { return Ok(Event::Multisig(multisig::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Preimage" { return Ok(Event::Preimage(preimage::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Bounties" { return Ok(Event::Bounties(bounties::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ChildBounties" { return Ok(Event::ChildBounties(child_bounties::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ElectionProviderMultiPhase" { return Ok(Event::ElectionProviderMultiPhase( @@ -381,14 +381,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Nis" { return Ok(Event::Nis(nis::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "NisCounterpartBalances" { return Ok(Event::NisCounterpartBalances( @@ -397,84 +397,84 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "VoterList" { return Ok(Event::VoterList(voter_list::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "NominationPools" { return Ok(Event::NominationPools(nomination_pools::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "FastUnstake" { return Ok(Event::FastUnstake(fast_unstake::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParaInclusion" { return Ok(Event::ParaInclusion(para_inclusion::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Paras" { return Ok(Event::Paras(paras::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Hrmp" { return Ok(Event::Hrmp(hrmp::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParasDisputes" { return Ok(Event::ParasDisputes(paras_disputes::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Registrar" { return Ok(Event::Registrar(registrar::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Slots" { return Ok(Event::Slots(slots::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Auctions" { return Ok(Event::Auctions(auctions::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Crowdloan" { return Ok(Event::Crowdloan(crowdloan::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "StateTrieMigration" { return Ok(Event::StateTrieMigration( @@ -483,21 +483,21 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "XcmPallet" { return Ok(Event::XcmPallet(xcm_pallet::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "MessageQueue" { return Ok(Event::MessageQueue(message_queue::Event::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Event enum", @@ -631,91 +631,91 @@ pub mod api { &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Babe" { return Ok(Call::Babe(babe::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Timestamp" { return Ok(Call::Timestamp(timestamp::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Indices" { return Ok(Call::Indices(indices::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Balances" { return Ok(Call::Balances(balances::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Staking" { return Ok(Call::Staking(staking::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Beefy" { return Ok(Call::Beefy(beefy::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Session" { return Ok(Call::Session(session::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Grandpa" { return Ok(Call::Grandpa(grandpa::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ImOnline" { return Ok(Call::ImOnline(im_online::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Treasury" { return Ok(Call::Treasury(treasury::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ConvictionVoting" { return Ok(Call::ConvictionVoting(conviction_voting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Referenda" { return Ok(Call::Referenda(referenda::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "FellowshipCollective" { return Ok(Call::FellowshipCollective( @@ -724,7 +724,7 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "FellowshipReferenda" { return Ok(Call::FellowshipReferenda( @@ -733,98 +733,98 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Whitelist" { return Ok(Call::Whitelist(whitelist::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Claims" { return Ok(Call::Claims(claims::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Utility" { return Ok(Call::Utility(utility::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Identity" { return Ok(Call::Identity(identity::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Society" { return Ok(Call::Society(society::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Recovery" { return Ok(Call::Recovery(recovery::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Vesting" { return Ok(Call::Vesting(vesting::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Scheduler" { return Ok(Call::Scheduler(scheduler::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Proxy" { return Ok(Call::Proxy(proxy::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Multisig" { return Ok(Call::Multisig(multisig::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Preimage" { return Ok(Call::Preimage(preimage::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Bounties" { return Ok(Call::Bounties(bounties::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ChildBounties" { return Ok(Call::ChildBounties(child_bounties::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ElectionProviderMultiPhase" { return Ok(Call::ElectionProviderMultiPhase( @@ -833,14 +833,14 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "Nis" { return Ok(Call::Nis(nis::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "NisCounterpartBalances" { return Ok(Call::NisCounterpartBalances( @@ -849,119 +849,119 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "VoterList" { return Ok(Call::VoterList(voter_list::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "NominationPools" { return Ok(Call::NominationPools(nomination_pools::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "FastUnstake" { return Ok(Call::FastUnstake(fast_unstake::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Configuration" { return Ok(Call::Configuration(configuration::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParasShared" { return Ok(Call::ParasShared(paras_shared::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParaInclusion" { return Ok(Call::ParaInclusion(para_inclusion::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParaInherent" { return Ok(Call::ParaInherent(para_inherent::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Paras" { return Ok(Call::Paras(paras::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Initializer" { return Ok(Call::Initializer(initializer::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Hrmp" { return Ok(Call::Hrmp(hrmp::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParasDisputes" { return Ok(Call::ParasDisputes(paras_disputes::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "ParasSlashing" { return Ok(Call::ParasSlashing(paras_slashing::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Registrar" { return Ok(Call::Registrar(registrar::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Slots" { return Ok(Call::Slots(slots::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Auctions" { return Ok(Call::Auctions(auctions::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "Crowdloan" { return Ok(Call::Crowdloan(crowdloan::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "StateTrieMigration" { return Ok(Call::StateTrieMigration( @@ -970,21 +970,21 @@ pub mod api { pallet_ty, metadata, )?, - )); + )) } if pallet_name == "XcmPallet" { return Ok(Call::XcmPallet(xcm_pallet::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } if pallet_name == "MessageQueue" { return Ok(Call::MessageQueue(message_queue::Call::decode_with_metadata( &mut &*pallet_bytes, pallet_ty, metadata, - )?)); + )?)) } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Call enum", @@ -1109,224 +1109,224 @@ pub mod api { let cursor = &mut &pallet_bytes[..]; if pallet_name == "System" { let variant_error = system::Error::decode_with_metadata(cursor, 528u32, metadata)?; - return Ok(Error::System(variant_error)); + return Ok(Error::System(variant_error)) } if pallet_name == "Babe" { let variant_error = babe::Error::decode_with_metadata(cursor, 544u32, metadata)?; - return Ok(Error::Babe(variant_error)); + return Ok(Error::Babe(variant_error)) } if pallet_name == "Indices" { let variant_error = indices::Error::decode_with_metadata(cursor, 546u32, metadata)?; - return Ok(Error::Indices(variant_error)); + return Ok(Error::Indices(variant_error)) } if pallet_name == "Balances" { let variant_error = balances::Error::decode_with_metadata(cursor, 562u32, metadata)?; - return Ok(Error::Balances(variant_error)); + return Ok(Error::Balances(variant_error)) } if pallet_name == "Staking" { let variant_error = staking::Error::decode_with_metadata(cursor, 586u32, metadata)?; - return Ok(Error::Staking(variant_error)); + return Ok(Error::Staking(variant_error)) } if pallet_name == "Beefy" { let variant_error = beefy::Error::decode_with_metadata(cursor, 591u32, metadata)?; - return Ok(Error::Beefy(variant_error)); + return Ok(Error::Beefy(variant_error)) } if pallet_name == "Session" { let variant_error = session::Error::decode_with_metadata(cursor, 597u32, metadata)?; - return Ok(Error::Session(variant_error)); + return Ok(Error::Session(variant_error)) } if pallet_name == "Grandpa" { let variant_error = grandpa::Error::decode_with_metadata(cursor, 601u32, metadata)?; - return Ok(Error::Grandpa(variant_error)); + return Ok(Error::Grandpa(variant_error)) } if pallet_name == "ImOnline" { let variant_error = im_online::Error::decode_with_metadata(cursor, 604u32, metadata)?; - return Ok(Error::ImOnline(variant_error)); + return Ok(Error::ImOnline(variant_error)) } if pallet_name == "Treasury" { let variant_error = treasury::Error::decode_with_metadata(cursor, 610u32, metadata)?; - return Ok(Error::Treasury(variant_error)); + return Ok(Error::Treasury(variant_error)) } if pallet_name == "ConvictionVoting" { let variant_error = conviction_voting::Error::decode_with_metadata(cursor, 623u32, metadata)?; - return Ok(Error::ConvictionVoting(variant_error)); + return Ok(Error::ConvictionVoting(variant_error)) } if pallet_name == "Referenda" { let variant_error = referenda::Error::decode_with_metadata(cursor, 641u32, metadata)?; - return Ok(Error::Referenda(variant_error)); + return Ok(Error::Referenda(variant_error)) } if pallet_name == "FellowshipCollective" { let variant_error = fellowship_collective::Error::decode_with_metadata(cursor, 646u32, metadata)?; - return Ok(Error::FellowshipCollective(variant_error)); + return Ok(Error::FellowshipCollective(variant_error)) } if pallet_name == "FellowshipReferenda" { let variant_error = fellowship_referenda::Error::decode_with_metadata(cursor, 650u32, metadata)?; - return Ok(Error::FellowshipReferenda(variant_error)); + return Ok(Error::FellowshipReferenda(variant_error)) } if pallet_name == "Whitelist" { let variant_error = whitelist::Error::decode_with_metadata(cursor, 651u32, metadata)?; - return Ok(Error::Whitelist(variant_error)); + return Ok(Error::Whitelist(variant_error)) } if pallet_name == "Claims" { let variant_error = claims::Error::decode_with_metadata(cursor, 652u32, metadata)?; - return Ok(Error::Claims(variant_error)); + return Ok(Error::Claims(variant_error)) } if pallet_name == "Utility" { let variant_error = utility::Error::decode_with_metadata(cursor, 653u32, metadata)?; - return Ok(Error::Utility(variant_error)); + return Ok(Error::Utility(variant_error)) } if pallet_name == "Identity" { let variant_error = identity::Error::decode_with_metadata(cursor, 664u32, metadata)?; - return Ok(Error::Identity(variant_error)); + return Ok(Error::Identity(variant_error)) } if pallet_name == "Society" { let variant_error = society::Error::decode_with_metadata(cursor, 681u32, metadata)?; - return Ok(Error::Society(variant_error)); + return Ok(Error::Society(variant_error)) } if pallet_name == "Recovery" { let variant_error = recovery::Error::decode_with_metadata(cursor, 685u32, metadata)?; - return Ok(Error::Recovery(variant_error)); + return Ok(Error::Recovery(variant_error)) } if pallet_name == "Vesting" { let variant_error = vesting::Error::decode_with_metadata(cursor, 689u32, metadata)?; - return Ok(Error::Vesting(variant_error)); + return Ok(Error::Vesting(variant_error)) } if pallet_name == "Scheduler" { let variant_error = scheduler::Error::decode_with_metadata(cursor, 694u32, metadata)?; - return Ok(Error::Scheduler(variant_error)); + return Ok(Error::Scheduler(variant_error)) } if pallet_name == "Proxy" { let variant_error = proxy::Error::decode_with_metadata(cursor, 703u32, metadata)?; - return Ok(Error::Proxy(variant_error)); + return Ok(Error::Proxy(variant_error)) } if pallet_name == "Multisig" { let variant_error = multisig::Error::decode_with_metadata(cursor, 707u32, metadata)?; - return Ok(Error::Multisig(variant_error)); + return Ok(Error::Multisig(variant_error)) } if pallet_name == "Preimage" { let variant_error = preimage::Error::decode_with_metadata(cursor, 712u32, metadata)?; - return Ok(Error::Preimage(variant_error)); + return Ok(Error::Preimage(variant_error)) } if pallet_name == "Bounties" { let variant_error = bounties::Error::decode_with_metadata(cursor, 716u32, metadata)?; - return Ok(Error::Bounties(variant_error)); + return Ok(Error::Bounties(variant_error)) } if pallet_name == "ChildBounties" { let variant_error = child_bounties::Error::decode_with_metadata(cursor, 719u32, metadata)?; - return Ok(Error::ChildBounties(variant_error)); + return Ok(Error::ChildBounties(variant_error)) } if pallet_name == "ElectionProviderMultiPhase" { let variant_error = election_provider_multi_phase::Error::decode_with_metadata( cursor, 729u32, metadata, )?; - return Ok(Error::ElectionProviderMultiPhase(variant_error)); + return Ok(Error::ElectionProviderMultiPhase(variant_error)) } if pallet_name == "Nis" { let variant_error = nis::Error::decode_with_metadata(cursor, 737u32, metadata)?; - return Ok(Error::Nis(variant_error)); + return Ok(Error::Nis(variant_error)) } if pallet_name == "NisCounterpartBalances" { let variant_error = nis_counterpart_balances::Error::decode_with_metadata( cursor, 742u32, metadata, )?; - return Ok(Error::NisCounterpartBalances(variant_error)); + return Ok(Error::NisCounterpartBalances(variant_error)) } if pallet_name == "VoterList" { let variant_error = voter_list::Error::decode_with_metadata(cursor, 746u32, metadata)?; - return Ok(Error::VoterList(variant_error)); + return Ok(Error::VoterList(variant_error)) } if pallet_name == "NominationPools" { let variant_error = nomination_pools::Error::decode_with_metadata(cursor, 764u32, metadata)?; - return Ok(Error::NominationPools(variant_error)); + return Ok(Error::NominationPools(variant_error)) } if pallet_name == "FastUnstake" { let variant_error = fast_unstake::Error::decode_with_metadata(cursor, 769u32, metadata)?; - return Ok(Error::FastUnstake(variant_error)); + return Ok(Error::FastUnstake(variant_error)) } if pallet_name == "Configuration" { let variant_error = configuration::Error::decode_with_metadata(cursor, 773u32, metadata)?; - return Ok(Error::Configuration(variant_error)); + return Ok(Error::Configuration(variant_error)) } if pallet_name == "ParaInclusion" { let variant_error = para_inclusion::Error::decode_with_metadata(cursor, 781u32, metadata)?; - return Ok(Error::ParaInclusion(variant_error)); + return Ok(Error::ParaInclusion(variant_error)) } if pallet_name == "ParaInherent" { let variant_error = para_inherent::Error::decode_with_metadata(cursor, 787u32, metadata)?; - return Ok(Error::ParaInherent(variant_error)); + return Ok(Error::ParaInherent(variant_error)) } if pallet_name == "Paras" { let variant_error = paras::Error::decode_with_metadata(cursor, 812u32, metadata)?; - return Ok(Error::Paras(variant_error)); + return Ok(Error::Paras(variant_error)) } if pallet_name == "Hrmp" { let variant_error = hrmp::Error::decode_with_metadata(cursor, 824u32, metadata)?; - return Ok(Error::Hrmp(variant_error)); + return Ok(Error::Hrmp(variant_error)) } if pallet_name == "ParasDisputes" { let variant_error = paras_disputes::Error::decode_with_metadata(cursor, 833u32, metadata)?; - return Ok(Error::ParasDisputes(variant_error)); + return Ok(Error::ParasDisputes(variant_error)) } if pallet_name == "ParasSlashing" { let variant_error = paras_slashing::Error::decode_with_metadata(cursor, 838u32, metadata)?; - return Ok(Error::ParasSlashing(variant_error)); + return Ok(Error::ParasSlashing(variant_error)) } if pallet_name == "Registrar" { let variant_error = registrar::Error::decode_with_metadata(cursor, 841u32, metadata)?; - return Ok(Error::Registrar(variant_error)); + return Ok(Error::Registrar(variant_error)) } if pallet_name == "Slots" { let variant_error = slots::Error::decode_with_metadata(cursor, 843u32, metadata)?; - return Ok(Error::Slots(variant_error)); + return Ok(Error::Slots(variant_error)) } if pallet_name == "Auctions" { let variant_error = auctions::Error::decode_with_metadata(cursor, 848u32, metadata)?; - return Ok(Error::Auctions(variant_error)); + return Ok(Error::Auctions(variant_error)) } if pallet_name == "Crowdloan" { let variant_error = crowdloan::Error::decode_with_metadata(cursor, 851u32, metadata)?; - return Ok(Error::Crowdloan(variant_error)); + return Ok(Error::Crowdloan(variant_error)) } if pallet_name == "StateTrieMigration" { let variant_error = state_trie_migration::Error::decode_with_metadata(cursor, 508u32, metadata)?; - return Ok(Error::StateTrieMigration(variant_error)); + return Ok(Error::StateTrieMigration(variant_error)) } if pallet_name == "XcmPallet" { let variant_error = xcm_pallet::Error::decode_with_metadata(cursor, 873u32, metadata)?; - return Ok(Error::XcmPallet(variant_error)); + return Ok(Error::XcmPallet(variant_error)) } if pallet_name == "MessageQueue" { let variant_error = message_queue::Error::decode_with_metadata(cursor, 880u32, metadata)?; - return Ok(Error::MessageQueue(variant_error)); + return Ok(Error::MessageQueue(variant_error)) } Err(::subxt::ext::scale_decode::Error::custom(format!( "Pallet name '{}' not found in root Error enum", From a86a8d6996b3e95d48a1aa1fcc0cdcc918bfbb08 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Wed, 20 Dec 2023 14:25:01 -0300 Subject: [PATCH 08/22] fix log target for parachain --- hyperspace/parachain/src/chain.rs | 4 ++-- hyperspace/parachain/src/finality_protocol.rs | 8 ++++---- hyperspace/parachain/src/light_client_sync.rs | 2 +- hyperspace/parachain/src/parachain.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hyperspace/parachain/src/chain.rs b/hyperspace/parachain/src/chain.rs index 3cf422a22..71292323a 100644 --- a/hyperspace/parachain/src/chain.rs +++ b/hyperspace/parachain/src/chain.rs @@ -332,7 +332,7 @@ where } else { error.to_string() }; - log::debug!(target: "hyperspace", "Handling error: {err_str}"); + log::debug!(target: "hyperspace_parachain", "Handling error: {err_str}"); if err_str.contains("MaxSlotsExceeded") { self.common_state.rpc_call_delay = self.common_state.rpc_call_delay * 2; @@ -366,7 +366,7 @@ where self.relay_client = relay_client; self.para_client = para_client; - log::info!(target: "hyperspace", "Reconnected to relay chain and parachain"); + log::info!(target: "hyperspace_parachain", "Reconnected to relay chain and parachain"); Ok(()) } diff --git a/hyperspace/parachain/src/finality_protocol.rs b/hyperspace/parachain/src/finality_protocol.rs index f8e7dc5c6..233b5efcd 100644 --- a/hyperspace/parachain/src/finality_protocol.rs +++ b/hyperspace/parachain/src/finality_protocol.rs @@ -384,13 +384,13 @@ where ::AccountId: Send + Sync, ::Address: Send + Sync, { - log::debug!(target: "hyperspace", "Trying to find next justification in blocks {from}..{to}"); + log::debug!(target: "hyperspace_parachain", "Trying to find next justification in blocks {from}..{to}"); let mut join_set: JoinSet> = JoinSet::new(); let heights = (from..to).collect::>(); for heights in heights.chunks(PROCESS_BLOCKS_BATCH_SIZE) { for height in heights.to_owned() { if height % 100 == 0 { - log::debug!(target: "hyperspace", "Looking for a closer proof {height}/{to}..."); + log::debug!(target: "hyperspace_parachain", "Looking for a closer proof {height}/{to}..."); } let relay_client = prover.relay_client.clone(); let delay = prover.rpc_call_delay.as_millis(); @@ -405,7 +405,7 @@ where }; let Some(justifications) = block.justifications else { return Ok(None) }; for (id, justification) in justifications { - log::info!(target: "hyperspace", "Found closer justification at {height} (suggested {to})"); + log::info!(target: "hyperspace_parachain", "Found closer justification at {height} (suggested {to})"); if id == GRANDPA_ENGINE_ID { let decoded_justification = GrandpaJustification::::decode(&mut &justification[..])?; @@ -614,7 +614,7 @@ where .collect::>(), &channel_and_port_ids, ); - log::trace!(target: "hyperspace", "Filtering event: {:?}: {f}", e.event_type()); + log::trace!(target: "hyperspace_parachain", "Filtering event: {:?}: {f}", e.event_type()); f }) .collect(); diff --git a/hyperspace/parachain/src/light_client_sync.rs b/hyperspace/parachain/src/light_client_sync.rs index e4e614c11..3a2d453a5 100644 --- a/hyperspace/parachain/src/light_client_sync.rs +++ b/hyperspace/parachain/src/light_client_sync.rs @@ -209,7 +209,7 @@ where let mut count = 0; while session_end_block <= latest_finalized_height && count < limit { log::debug!( - target: "hyperspace", + target: "hyperspace_parachain", "Getting message for session end block: #{} (finalized #{}) ({}/{})", session_end_block, latest_finalized_height, count + 1, limit ); diff --git a/hyperspace/parachain/src/parachain.rs b/hyperspace/parachain/src/parachain.rs index e5e907ff0..49c3d446d 100644 --- a/hyperspace/parachain/src/parachain.rs +++ b/hyperspace/parachain/src/parachain.rs @@ -48,7 +48,7 @@ impl Decode for UncheckedExtrinsic { let signature = is_signed.then(|| Decode::decode(input)).transpose()?; let function = Decode::decode(input).map_err(|e| { - log::error!(target: "hyperspace", "Failed to decode extrinsic: {:?}.\nCheck that the chain's SignedExtra is correct", e); + log::error!(target: "hyperspace_parachain", "Failed to decode extrinsic: {:?}.\nCheck that the chain's SignedExtra is correct", e); e })?; From 850cce2b0bf448ba2c9b35a12652e5795336d235 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Wed, 20 Dec 2023 19:44:34 -0300 Subject: [PATCH 09/22] add chain name to AnyError message --- Cargo.lock | 16 +++++++- hyperspace/core/Cargo.toml | 1 + hyperspace/core/src/macros.rs | 5 ++- hyperspace/macros/Cargo.toml | 15 ++++++++ hyperspace/macros/src/lib.rs | 70 +++++++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 hyperspace/macros/Cargo.toml create mode 100644 hyperspace/macros/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 0eeb254de..7f26a22db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1160,9 +1160,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" dependencies = [ "smallvec", ] @@ -4600,6 +4600,7 @@ dependencies = [ "futures", "hex", "hyperspace-cosmos", + "hyperspace-macros", "hyperspace-metrics", "hyperspace-parachain", "hyperspace-primitives", @@ -4683,6 +4684,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "hyperspace-macros" +version = "0.1.0" +dependencies = [ + "convert_case 0.6.0", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "hyperspace-metrics" version = "0.1.0" diff --git a/hyperspace/core/Cargo.toml b/hyperspace/core/Cargo.toml index 56b3dbfcc..5b7f66794 100644 --- a/hyperspace/core/Cargo.toml +++ b/hyperspace/core/Cargo.toml @@ -69,6 +69,7 @@ frame-system = { git = "https://github.com/paritytech/substrate", branch = "polk frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false } prost = { version = "0.11", default-features = false } serde_json = "1.0.74" +hyperspace-macros = { path = "../macros", package = "hyperspace-macros" } [dev-dependencies] derive_more = "0.99.17" diff --git a/hyperspace/core/src/macros.rs b/hyperspace/core/src/macros.rs index fff0ab73f..6106eaf78 100644 --- a/hyperspace/core/src/macros.rs +++ b/hyperspace/core/src/macros.rs @@ -62,13 +62,14 @@ macro_rules! chains { } #[derive(Error, Debug)] + #[hyperspace_macros::any_error] pub enum AnyError { $( $(#[$($meta)*])* - #[error("{0}")] + #[error(" error: {0}")] $name(<$client as IbcProvider>::Error), )* - #[error("{0}")] + #[error(" error: {0}")] Other(String), } diff --git a/hyperspace/macros/Cargo.toml b/hyperspace/macros/Cargo.toml new file mode 100644 index 000000000..ead19bdbc --- /dev/null +++ b/hyperspace/macros/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "hyperspace-macros" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[dependencies] +syn = { version = "1.0.99", features = ["extra-traits", "full", "derive", "parsing"] } +quote = "1.0.21" +proc-macro2 = "1.0.43" +convert_case = "0.6.0" +proc-macro-crate = "1.2.1" + +[lib] +proc-macro = true diff --git a/hyperspace/macros/src/lib.rs b/hyperspace/macros/src/lib.rs new file mode 100644 index 000000000..e0909a91b --- /dev/null +++ b/hyperspace/macros/src/lib.rs @@ -0,0 +1,70 @@ +// Copyright 2022 ComposableFi +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![allow(clippy::all)] + +use proc_macro::{Span, TokenStream}; +use proc_macro2::{Ident, TokenTree}; +use quote::{quote, ToTokens}; + +use syn::{ + buffer::TokenBuffer, parse_macro_input, Attribute, Data, DeriveInput, Generics, ItemEnum, Meta, + NestedMeta::Lit, Path, Type, TypePath, +}; + +#[proc_macro_attribute] +pub fn any_error(_attr: TokenStream, item: TokenStream) -> TokenStream { + let mut input = parse_macro_input!(item as ItemEnum); + input.variants = input + .variants + .into_iter() + .map(|mut var| { + var.attrs = var + .attrs + .into_iter() + .map(|mut attr| { + if attr.path.segments.len() == 1 && attr.path.segments[0].ident == "error" { + let mut meta = attr.parse_meta().unwrap(); + match &mut meta { + Meta::List(ref mut list) => match &mut list.nested[0] { + Lit(syn::Lit::Str(s)) => { + let var_name = var.ident.to_string(); + let new_msg = format!("{var_name}{}", s.value()); + attr = syn::parse_quote!(#[error(#new_msg)]); + }, + _ => { + panic!("error attribute must be a string literal") + }, + }, + _ => { + panic!("error attribute must be a string literal") + }, + } + attr + } else { + attr + } + }) + .collect(); + var + }) + .collect(); + input.to_token_stream().into() +} + +#[proc_macro_derive(AnyError, attributes(error))] +pub fn derive_client_message(input: TokenStream) -> TokenStream { + println!("input: \"{}\"", input.to_string()); + input +} From c0372612497abff98b9303fbb296c78df353d130 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Wed, 20 Dec 2023 23:33:58 -0300 Subject: [PATCH 10/22] fix deps --- hyperspace/macros/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/hyperspace/macros/Cargo.toml b/hyperspace/macros/Cargo.toml index ead19bdbc..46c08b043 100644 --- a/hyperspace/macros/Cargo.toml +++ b/hyperspace/macros/Cargo.toml @@ -8,8 +8,6 @@ license = "Apache-2.0" syn = { version = "1.0.99", features = ["extra-traits", "full", "derive", "parsing"] } quote = "1.0.21" proc-macro2 = "1.0.43" -convert_case = "0.6.0" -proc-macro-crate = "1.2.1" [lib] proc-macro = true From b0a995732098b80369ac9d438e46f137f982be75 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Thu, 21 Dec 2023 12:55:46 -0300 Subject: [PATCH 11/22] update lockfile --- Cargo.lock | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f26a22db..b1571f499 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4688,8 +4688,6 @@ dependencies = [ name = "hyperspace-macros" version = "0.1.0" dependencies = [ - "convert_case 0.6.0", - "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", From d7ff1cc7a09241439e37f16b15fa5fc9bc54cc6f Mon Sep 17 00:00:00 2001 From: Vladislav Date: Tue, 19 Dec 2023 18:17:17 -0300 Subject: [PATCH 12/22] Fix overflow (#464) * Fix overflow * Revert "subxt update (#462)" This reverts commit 687ff2f5989ebb1ad37e054b9bb198baeadc9f6b. (cherry picked from commit e868518fdb4500710a8208068ad4a26904a74bce) --- hyperspace/parachain/src/provider.rs | 2 +- utils/subxt/generated/src/composable/parachain.rs | 2 +- utils/subxt/generated/src/picasso_kusama/parachain.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hyperspace/parachain/src/provider.rs b/hyperspace/parachain/src/provider.rs index cd515fc5c..12af4f901 100644 --- a/hyperspace/parachain/src/provider.rs +++ b/hyperspace/parachain/src/provider.rs @@ -709,7 +709,7 @@ where // this update is required let base = if cfg!(test) { (session_length / 2) as u64 } else { (session_length / 12) as u64 }; - let diff = latest_height - latest_client_height_on_counterparty; + let diff = latest_height.saturating_sub(latest_client_height_on_counterparty); let pruning_len = 256; Ok(diff >= base.min(pruning_len as u64)) } diff --git a/utils/subxt/generated/src/composable/parachain.rs b/utils/subxt/generated/src/composable/parachain.rs index c75eba666..769a8eee9 100644 --- a/utils/subxt/generated/src/composable/parachain.rs +++ b/utils/subxt/generated/src/composable/parachain.rs @@ -31585,7 +31585,7 @@ pub mod api { module_id: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 24)] - PushWasmCode { wasm_code_id: ::std::vec::Vec<::core::primitive::u8> }, + PushWasmCode { wasm_checksum: ::std::vec::Vec<::core::primitive::u8> }, } } pub mod ics20_fee { diff --git a/utils/subxt/generated/src/picasso_kusama/parachain.rs b/utils/subxt/generated/src/picasso_kusama/parachain.rs index 4c9db4414..36e5bedb6 100644 --- a/utils/subxt/generated/src/picasso_kusama/parachain.rs +++ b/utils/subxt/generated/src/picasso_kusama/parachain.rs @@ -35933,7 +35933,7 @@ pub mod api { module_id: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 24)] - PushWasmCode { wasm_code_id: ::std::vec::Vec<::core::primitive::u8> }, + PushWasmCode { wasm_checksum: ::std::vec::Vec<::core::primitive::u8> }, } } pub mod ics20_fee { From 976bfc99dae76e2220384e827aa0b56aac10680c Mon Sep 17 00:00:00 2001 From: Vladislav Date: Fri, 9 Feb 2024 12:57:06 -0300 Subject: [PATCH 13/22] Cosmos fixes and improvements; metric handling fix (#474) * Fix cosmos client next updates and improve some of the queries * Return in `MetricsHandler::handle_events` if no new height was found (cherry picked from commit 883cb03159836f625a8bf6337e85feaf117670df) --- hyperspace/cosmos/src/client.rs | 14 ++-- hyperspace/cosmos/src/provider.rs | 116 +++++++++++++++++------------- hyperspace/metrics/src/handler.rs | 3 + 3 files changed, 79 insertions(+), 54 deletions(-) diff --git a/hyperspace/cosmos/src/client.rs b/hyperspace/cosmos/src/client.rs index 0fce2c50b..3c0344bbe 100644 --- a/hyperspace/cosmos/src/client.rs +++ b/hyperspace/cosmos/src/client.rs @@ -253,15 +253,15 @@ where pub async fn new(config: CosmosClientConfig) -> Result { let (rpc_client, rpc_driver) = WebSocketClient::new(config.websocket_url.clone()) .await - .map_err(|e| Error::RpcError(format!("{:?}", e)))?; + .map_err(|e| Error::RpcError(format!("failed to connect to Websocket {:?}", e)))?; let rpc_http_client = HttpClient::new(config.rpc_url.clone()) - .map_err(|e| Error::RpcError(format!("{:?}", e)))?; + .map_err(|e| Error::RpcError(format!("failed to connect to RPC {:?}", e)))?; let ws_driver_jh = tokio::spawn(rpc_driver.run()); let grpc_client = tonic::transport::Endpoint::new(config.grpc_url.to_string()) - .map_err(|e| Error::RpcError(format!("{:?}", e)))? + .map_err(|e| Error::RpcError(format!("failed to create a GRPC endpoint {:?}", e)))? .connect() .await - .map_err(|e| Error::RpcError(format!("{:?}", e)))?; + .map_err(|e| Error::RpcError(format!("failed to connect to GRPC {:?}", e)))?; let chain_id = ChainId::from(config.chain_id); let light_client = @@ -401,15 +401,17 @@ where to: TmHeight, trusted_height: Height, ) -> Result, Error> { + let from = from.increment(); let mut xs = Vec::new(); let heightss = (from.value()..=to.value()).collect::>(); let client = Arc::new(self.clone()); - let to = self.rpc_call_delay().as_millis(); + let delay_to = self.rpc_call_delay().as_millis(); for heights in heightss.chunks(5) { let mut join_set = JoinSet::, Elapsed>>::new(); for height in heights.to_owned() { let client = client.clone(); - let duration = Duration::from_millis(rand::thread_rng().gen_range(0..to) as u64); + let duration = + Duration::from_millis(rand::thread_rng().gen_range(0..delay_to) as u64); let fut = async move { log::trace!(target: "hyperspace_cosmos", "Fetching header at height {:?}", height); let latest_light_block = diff --git a/hyperspace/cosmos/src/provider.rs b/hyperspace/cosmos/src/provider.rs index bf74afb72..d3204ebbb 100644 --- a/hyperspace/cosmos/src/provider.rs +++ b/hyperspace/cosmos/src/provider.rs @@ -23,12 +23,13 @@ use ibc::{ identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, path::{ AcksPath, ChannelEndsPath, ClientConsensusStatePath, ClientStatePath, - CommitmentsPath, ConnectionsPath, Path, ReceiptsPath, SeqRecvsPath, + CommitmentsPath, ConnectionsPath, Path, ReceiptsPath, SeqRecvsPath, SeqSendsPath, }, }, }, events::IbcEvent, protobuf::Protobuf, + signer::Signer, timestamp::Timestamp, tx_msg::Msg, Height, @@ -82,7 +83,9 @@ use tendermint_rpc::{ }; use tokio::{task::JoinSet, time::sleep}; -pub const NUMBER_OF_BLOCKS_TO_PROCESS_PER_ITER: u64 = 250; +// At least one *mandatory* update should happen during that period +// TODO: make it configurable +pub const NUMBER_OF_BLOCKS_TO_PROCESS_PER_ITER: u64 = 500; #[derive(Clone, Debug)] pub enum FinalityEvent { @@ -141,7 +144,6 @@ where let update_headers = self.msg_update_client_header(from, to, client_state.latest_height).await?; let mut block_events = Vec::new(); - block_events.push((0, Vec::new())); let mut join_set: JoinSet> = JoinSet::new(); let range = (from.value()..to.value()).collect::>(); let to = self.rpc_call_delay().as_millis(); @@ -177,9 +179,15 @@ where block_events.sort_by_key(|(height, _)| *height); let mut updates = Vec::new(); - for (events, (update_header, update_type)) in - block_events.into_iter().map(|(_, events)| events).zip(update_headers) + for (i, (events, (update_header, mut update_type))) in block_events + .into_iter() + .map(|(_, events)| events) + .zip(update_headers) + .enumerate() { + if i == NUMBER_OF_BLOCKS_TO_PROCESS_PER_ITER as usize - 1 { + update_type = UpdateType::Mandatory; + } let height = update_header.height(); let update_client_header = { let msg = MsgUpdateAnyClient:: { @@ -231,17 +239,17 @@ where let Event { data, events: _, query } = event.unwrap(); match data { EventData::NewBlock { block, .. } - if query == Query::from(EventType::NewBlock).to_string() => - { - let height = Height::new( - ChainId::chain_version(chain_id.to_string().as_str()), - u64::from(block.as_ref().ok_or("tx.height").unwrap().header.height), - ); - events_with_height.push(IbcEventWithHeight::new( - ClientEvents::NewBlock::new(height).into(), - height, - )); - }, + if query == Query::from(EventType::NewBlock).to_string() => + { + let height = Height::new( + ChainId::chain_version(chain_id.to_string().as_str()), + u64::from(block.as_ref().ok_or("tx.height").unwrap().header.height), + ); + events_with_height.push(IbcEventWithHeight::new( + ClientEvents::NewBlock::new(height).into(), + height, + )); + }, EventData::Tx { tx_result } => { let height = Height::new( ChainId::chain_version(chain_id.to_string().as_str()), @@ -265,10 +273,10 @@ where events_with_height .push(IbcEventWithHeight::new(ibc_event, height)); } else { - log::debug!(target: "hyperspace_cosmos", "The event is unknown"); + log::debug!(target: "hyperspace_cosmos", "the event is unknown"); } } else { - log::debug!(target: "hyperspace_cosmos", "Failed to parse event {:?}", abci_event); + log::debug!(target: "hyperspace_cosmos", "Event wasn't parsed {:?}", abci_event); } } }, @@ -313,6 +321,9 @@ where Path::ClientState(ClientStatePath(client_id.clone())).to_string().into_bytes(); let (q, proof) = self.query_path(path_bytes.clone(), at, true).await?; let client_state = Any::decode(&*q.value)?; + if client_state.type_url.is_empty() || client_state.value.is_empty() { + return Err(Error::Custom(format!("empty client state for height {at}"))) + } Ok(QueryClientStateResponse { client_state: Some(client_state), proof, @@ -513,7 +524,6 @@ where let commitment_sequences: Vec = response.commitments.into_iter().map(|v| v.sequence).collect(); - Ok(commitment_sequences) } @@ -807,7 +817,7 @@ where fn expected_block_time(&self) -> Duration { // cosmos chain block time is roughly 6-7 seconds - Duration::from_secs(7) + Duration::from_secs(5) } async fn query_client_update_time_and_height( @@ -815,44 +825,54 @@ where client_id: ClientId, client_height: Height, ) -> Result<(Height, Timestamp), Self::Error> { - log::trace!( + log::debug!( target: "hyperspace_cosmos", "Querying client update time and height for client {:?} at height {:?}", client_id, client_height ); - let query_str = Query::eq("update_client.client_id", client_id.to_string()) + let query_update = Query::eq("update_client.client_id", client_id.to_string()) .and_eq("update_client.consensus_height", client_height.to_string()); + let query_create = Query::eq("create_client.client_id", client_id.to_string()) + .and_eq("create_client.consensus_height", client_height.to_string()); + for query_str in [query_update, query_create] { + let response = self + .rpc_http_client + .tx_search( + query_str, + true, + 1, + 1, // get only the first Tx matching the query + Order::Ascending, + ) + .await + .map_err(|e| Error::RpcError(format!("{e:?}")))?; - let response = self - .rpc_http_client - .tx_search( - query_str, - true, - 1, - 1, // get only the first Tx matching the query - Order::Ascending, - ) - .await - .map_err(|e| Error::RpcError(format!("{e:?}")))?; - - for tx in response.txs { - for ev in &tx.tx_result.events { - let height = tx.height.value(); - let ev = - ibc_event_try_from_abci_event(ev, Height::new(self.id().version(), height)); - let timestamp = self.query_timestamp_at(height).await?; - match ev { - Ok(IbcEvent::UpdateClient(e)) if e.client_id() == &client_id => - return Ok(( - Height::new(self.chain_id.version(), height), - Timestamp::from_nanoseconds(timestamp)?, - )), - _ => (), + for tx in response.txs { + for ev in &tx.tx_result.events { + let height = tx.height.value(); + let ev = + ibc_event_try_from_abci_event(ev, Height::new(self.id().version(), height)); + let timestamp = self + .query_timestamp_at(height) + .await + .map_err(|e| Error::RpcError(format!("{e:?}")))?; + match ev { + Ok(IbcEvent::UpdateClient(e)) if e.client_id() == &client_id => + return Ok(( + Height::new(self.chain_id.version(), height), + Timestamp::from_nanoseconds(timestamp)?, + )), + Ok(IbcEvent::CreateClient(e)) if e.client_id() == &client_id => + return Ok(( + Height::new(self.chain_id.version(), height), + Timestamp::from_nanoseconds(timestamp)?, + )), + _ => (), + } } } } - Err(Error::from("not found".to_string())) } diff --git a/hyperspace/metrics/src/handler.rs b/hyperspace/metrics/src/handler.rs index 7367b7e0a..f1ae73a28 100644 --- a/hyperspace/metrics/src/handler.rs +++ b/hyperspace/metrics/src/handler.rs @@ -159,6 +159,9 @@ impl MetricsHandler { _ => (), } } + if new_latest_processed_height == 0 { + return Ok(()) + } self.metrics.update_latest_processed_height(new_latest_processed_height)?; Ok(()) } From e258cc9cdb4b92f17fe96025f73fecfe7e7d0e59 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Fri, 9 Feb 2024 15:38:04 -0300 Subject: [PATCH 14/22] Update Cargo.lock --- Cargo.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b3209a3d0..f79007fa0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4822,7 +4822,9 @@ dependencies = [ "sp-state-machine 0.13.0", "sp-trie 7.0.0", "subxt", + "tendermint", "tendermint-proto", + "tendermint-rpc", "tokio", "toml 0.7.6", ] From 1c4a6bba8991b2ef5edf0c0acab686ab8b3fd5c1 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Fri, 9 Feb 2024 16:06:40 -0300 Subject: [PATCH 15/22] Update Cargo.lock --- Cargo.lock | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f79007fa0..b3209a3d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4822,9 +4822,7 @@ dependencies = [ "sp-state-machine 0.13.0", "sp-trie 7.0.0", "subxt", - "tendermint", "tendermint-proto", - "tendermint-rpc", "tokio", "toml 0.7.6", ] From 47d6ee039d026731ff9d0a6a0448a784176bc743 Mon Sep 17 00:00:00 2001 From: Kanstantsin Kastsevich Date: Tue, 19 Dec 2023 04:02:28 +0300 Subject: [PATCH 16/22] subxt update (#462) (cherry picked from commit 687ff2f5989ebb1ad37e054b9bb198baeadc9f6b) --- utils/subxt/generated/src/composable/parachain.rs | 2 +- utils/subxt/generated/src/picasso_kusama/parachain.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/subxt/generated/src/composable/parachain.rs b/utils/subxt/generated/src/composable/parachain.rs index 769a8eee9..c75eba666 100644 --- a/utils/subxt/generated/src/composable/parachain.rs +++ b/utils/subxt/generated/src/composable/parachain.rs @@ -31585,7 +31585,7 @@ pub mod api { module_id: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 24)] - PushWasmCode { wasm_checksum: ::std::vec::Vec<::core::primitive::u8> }, + PushWasmCode { wasm_code_id: ::std::vec::Vec<::core::primitive::u8> }, } } pub mod ics20_fee { diff --git a/utils/subxt/generated/src/picasso_kusama/parachain.rs b/utils/subxt/generated/src/picasso_kusama/parachain.rs index 36e5bedb6..4c9db4414 100644 --- a/utils/subxt/generated/src/picasso_kusama/parachain.rs +++ b/utils/subxt/generated/src/picasso_kusama/parachain.rs @@ -35933,7 +35933,7 @@ pub mod api { module_id: ::std::vec::Vec<::core::primitive::u8>, }, #[codec(index = 24)] - PushWasmCode { wasm_checksum: ::std::vec::Vec<::core::primitive::u8> }, + PushWasmCode { wasm_code_id: ::std::vec::Vec<::core::primitive::u8> }, } } pub mod ics20_fee { From d775eb6676bd74aa4a35bd97ee9c9988ad0800e4 Mon Sep 17 00:00:00 2001 From: Kanstantsin Kastsevich Date: Wed, 27 Dec 2023 23:02:58 +0300 Subject: [PATCH 17/22] subxt update (#466) (cherry picked from commit 0951dac828a302b64a81d6264f9d7855250b612e) --- .../generated/src/picasso_kusama/parachain.rs | 361 ++++++++++++------ 1 file changed, 249 insertions(+), 112 deletions(-) diff --git a/utils/subxt/generated/src/picasso_kusama/parachain.rs b/utils/subxt/generated/src/picasso_kusama/parachain.rs index 4c9db4414..63f0f0b24 100644 --- a/utils/subxt/generated/src/picasso_kusama/parachain.rs +++ b/utils/subxt/generated/src/picasso_kusama/parachain.rs @@ -1838,9 +1838,9 @@ pub mod api { let runtime_metadata_hash = client.metadata().hasher().only_these_pallets(&PALLETS).hash(); if runtime_metadata_hash != [ - 28u8, 71u8, 161u8, 32u8, 77u8, 8u8, 46u8, 172u8, 93u8, 63u8, 16u8, 181u8, 6u8, - 171u8, 141u8, 255u8, 199u8, 226u8, 129u8, 188u8, 188u8, 27u8, 131u8, 197u8, 110u8, - 118u8, 29u8, 42u8, 57u8, 54u8, 15u8, 160u8, + 129u8, 247u8, 183u8, 160u8, 143u8, 152u8, 149u8, 105u8, 151u8, 31u8, 45u8, 162u8, + 205u8, 39u8, 105u8, 80u8, 123u8, 136u8, 46u8, 75u8, 187u8, 189u8, 210u8, 3u8, + 165u8, 68u8, 29u8, 197u8, 229u8, 30u8, 179u8, 115u8, ] { Err(::subxt::error::MetadataError::IncompatibleCodegen) } else { @@ -2963,9 +2963,10 @@ pub mod api { "sudo", types::Sudo { call: ::std::boxed::Box::new(call) }, [ - 119u8, 209u8, 229u8, 178u8, 207u8, 177u8, 75u8, 35u8, 6u8, 234u8, 12u8, - 67u8, 99u8, 242u8, 152u8, 85u8, 38u8, 132u8, 80u8, 211u8, 162u8, 175u8, - 47u8, 135u8, 88u8, 150u8, 142u8, 104u8, 190u8, 101u8, 176u8, 253u8, + 167u8, 204u8, 68u8, 160u8, 239u8, 160u8, 192u8, 129u8, 193u8, 65u8, + 40u8, 93u8, 167u8, 181u8, 146u8, 193u8, 49u8, 240u8, 87u8, 69u8, 195u8, + 77u8, 185u8, 144u8, 119u8, 127u8, 107u8, 159u8, 96u8, 14u8, 241u8, + 20u8, ], ) } @@ -2979,10 +2980,9 @@ pub mod api { "sudo_unchecked_weight", types::SudoUncheckedWeight { call: ::std::boxed::Box::new(call), weight }, [ - 19u8, 107u8, 21u8, 228u8, 233u8, 99u8, 228u8, 241u8, 131u8, 126u8, - 172u8, 130u8, 71u8, 195u8, 77u8, 89u8, 221u8, 166u8, 85u8, 73u8, 38u8, - 205u8, 142u8, 85u8, 185u8, 190u8, 43u8, 25u8, 123u8, 172u8, 215u8, - 68u8, + 28u8, 125u8, 175u8, 213u8, 167u8, 54u8, 181u8, 53u8, 17u8, 112u8, + 246u8, 231u8, 147u8, 183u8, 36u8, 107u8, 91u8, 93u8, 36u8, 169u8, 15u8, + 161u8, 44u8, 7u8, 21u8, 90u8, 120u8, 68u8, 173u8, 146u8, 205u8, 55u8, ], ) } @@ -3018,9 +3018,10 @@ pub mod api { "sudo_as", types::SudoAs { who, call: ::std::boxed::Box::new(call) }, [ - 54u8, 228u8, 80u8, 195u8, 151u8, 6u8, 88u8, 130u8, 60u8, 185u8, 59u8, - 173u8, 18u8, 129u8, 95u8, 26u8, 18u8, 115u8, 201u8, 22u8, 137u8, 125u8, - 68u8, 108u8, 3u8, 87u8, 30u8, 26u8, 163u8, 121u8, 200u8, 78u8, + 84u8, 151u8, 72u8, 136u8, 128u8, 146u8, 174u8, 15u8, 168u8, 69u8, 63u8, + 184u8, 80u8, 234u8, 19u8, 109u8, 143u8, 247u8, 39u8, 203u8, 243u8, + 108u8, 235u8, 117u8, 129u8, 153u8, 191u8, 125u8, 188u8, 113u8, 154u8, + 133u8, ], ) } @@ -5904,10 +5905,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 154u8, 151u8, 3u8, 191u8, 152u8, 171u8, 136u8, 51u8, 251u8, 112u8, - 193u8, 141u8, 0u8, 173u8, 161u8, 176u8, 107u8, 10u8, 223u8, 107u8, - 55u8, 28u8, 18u8, 189u8, 170u8, 3u8, 81u8, 130u8, 239u8, 42u8, 167u8, - 128u8, + 37u8, 128u8, 12u8, 246u8, 19u8, 161u8, 231u8, 6u8, 46u8, 55u8, 71u8, + 73u8, 159u8, 40u8, 136u8, 8u8, 202u8, 209u8, 89u8, 84u8, 92u8, 204u8, + 65u8, 93u8, 212u8, 130u8, 69u8, 229u8, 1u8, 91u8, 91u8, 213u8, ], ) } @@ -5932,9 +5932,9 @@ pub mod api { max_weight, }, [ - 29u8, 157u8, 238u8, 7u8, 109u8, 220u8, 104u8, 29u8, 103u8, 153u8, 95u8, - 15u8, 2u8, 129u8, 116u8, 153u8, 207u8, 115u8, 247u8, 202u8, 19u8, 47u8, - 54u8, 229u8, 13u8, 121u8, 150u8, 209u8, 78u8, 110u8, 146u8, 36u8, + 58u8, 206u8, 88u8, 116u8, 241u8, 48u8, 127u8, 220u8, 228u8, 254u8, + 126u8, 114u8, 250u8, 201u8, 80u8, 115u8, 25u8, 36u8, 28u8, 30u8, 120u8, + 86u8, 104u8, 157u8, 75u8, 154u8, 215u8, 57u8, 88u8, 12u8, 32u8, 15u8, ], ) } @@ -7893,9 +7893,10 @@ pub mod api { "execute", types::Execute { proposal: ::std::boxed::Box::new(proposal), length_bound }, [ - 82u8, 33u8, 81u8, 14u8, 129u8, 202u8, 159u8, 242u8, 26u8, 39u8, 183u8, - 107u8, 3u8, 249u8, 97u8, 213u8, 44u8, 211u8, 88u8, 166u8, 129u8, 138u8, - 14u8, 155u8, 172u8, 226u8, 188u8, 149u8, 130u8, 83u8, 249u8, 58u8, + 247u8, 245u8, 61u8, 237u8, 29u8, 207u8, 10u8, 13u8, 140u8, 129u8, + 130u8, 144u8, 10u8, 139u8, 81u8, 215u8, 36u8, 28u8, 134u8, 191u8, + 148u8, 253u8, 15u8, 228u8, 116u8, 214u8, 255u8, 135u8, 115u8, 46u8, + 207u8, 245u8, ], ) } @@ -7914,9 +7915,9 @@ pub mod api { length_bound, }, [ - 137u8, 11u8, 241u8, 252u8, 171u8, 92u8, 51u8, 111u8, 151u8, 116u8, - 119u8, 97u8, 166u8, 71u8, 151u8, 220u8, 95u8, 228u8, 247u8, 148u8, 3u8, - 182u8, 194u8, 112u8, 226u8, 0u8, 25u8, 68u8, 214u8, 36u8, 22u8, 121u8, + 54u8, 106u8, 90u8, 70u8, 119u8, 54u8, 11u8, 48u8, 37u8, 184u8, 0u8, + 72u8, 147u8, 49u8, 223u8, 241u8, 187u8, 10u8, 8u8, 32u8, 190u8, 207u8, + 170u8, 126u8, 68u8, 26u8, 36u8, 87u8, 65u8, 195u8, 156u8, 174u8, ], ) } @@ -8148,9 +8149,10 @@ pub mod api { "ProposalOf", vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -8168,9 +8170,10 @@ pub mod api { "ProposalOf", Vec::new(), [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -9460,9 +9463,10 @@ pub mod api { "execute", types::Execute { proposal: ::std::boxed::Box::new(proposal), length_bound }, [ - 82u8, 33u8, 81u8, 14u8, 129u8, 202u8, 159u8, 242u8, 26u8, 39u8, 183u8, - 107u8, 3u8, 249u8, 97u8, 213u8, 44u8, 211u8, 88u8, 166u8, 129u8, 138u8, - 14u8, 155u8, 172u8, 226u8, 188u8, 149u8, 130u8, 83u8, 249u8, 58u8, + 247u8, 245u8, 61u8, 237u8, 29u8, 207u8, 10u8, 13u8, 140u8, 129u8, + 130u8, 144u8, 10u8, 139u8, 81u8, 215u8, 36u8, 28u8, 134u8, 191u8, + 148u8, 253u8, 15u8, 228u8, 116u8, 214u8, 255u8, 135u8, 115u8, 46u8, + 207u8, 245u8, ], ) } @@ -9481,9 +9485,9 @@ pub mod api { length_bound, }, [ - 137u8, 11u8, 241u8, 252u8, 171u8, 92u8, 51u8, 111u8, 151u8, 116u8, - 119u8, 97u8, 166u8, 71u8, 151u8, 220u8, 95u8, 228u8, 247u8, 148u8, 3u8, - 182u8, 194u8, 112u8, 226u8, 0u8, 25u8, 68u8, 214u8, 36u8, 22u8, 121u8, + 54u8, 106u8, 90u8, 70u8, 119u8, 54u8, 11u8, 48u8, 37u8, 184u8, 0u8, + 72u8, 147u8, 49u8, 223u8, 241u8, 187u8, 10u8, 8u8, 32u8, 190u8, 207u8, + 170u8, 126u8, 68u8, 26u8, 36u8, 87u8, 65u8, 195u8, 156u8, 174u8, ], ) } @@ -9715,9 +9719,10 @@ pub mod api { "ProposalOf", vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -9735,9 +9740,10 @@ pub mod api { "ProposalOf", Vec::new(), [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -10447,9 +10453,10 @@ pub mod api { "execute", types::Execute { proposal: ::std::boxed::Box::new(proposal), length_bound }, [ - 82u8, 33u8, 81u8, 14u8, 129u8, 202u8, 159u8, 242u8, 26u8, 39u8, 183u8, - 107u8, 3u8, 249u8, 97u8, 213u8, 44u8, 211u8, 88u8, 166u8, 129u8, 138u8, - 14u8, 155u8, 172u8, 226u8, 188u8, 149u8, 130u8, 83u8, 249u8, 58u8, + 247u8, 245u8, 61u8, 237u8, 29u8, 207u8, 10u8, 13u8, 140u8, 129u8, + 130u8, 144u8, 10u8, 139u8, 81u8, 215u8, 36u8, 28u8, 134u8, 191u8, + 148u8, 253u8, 15u8, 228u8, 116u8, 214u8, 255u8, 135u8, 115u8, 46u8, + 207u8, 245u8, ], ) } @@ -10468,9 +10475,9 @@ pub mod api { length_bound, }, [ - 137u8, 11u8, 241u8, 252u8, 171u8, 92u8, 51u8, 111u8, 151u8, 116u8, - 119u8, 97u8, 166u8, 71u8, 151u8, 220u8, 95u8, 228u8, 247u8, 148u8, 3u8, - 182u8, 194u8, 112u8, 226u8, 0u8, 25u8, 68u8, 214u8, 36u8, 22u8, 121u8, + 54u8, 106u8, 90u8, 70u8, 119u8, 54u8, 11u8, 48u8, 37u8, 184u8, 0u8, + 72u8, 147u8, 49u8, 223u8, 241u8, 187u8, 10u8, 8u8, 32u8, 190u8, 207u8, + 170u8, 126u8, 68u8, 26u8, 36u8, 87u8, 65u8, 195u8, 156u8, 174u8, ], ) } @@ -10702,9 +10709,10 @@ pub mod api { "ProposalOf", vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -10722,9 +10730,10 @@ pub mod api { "ProposalOf", Vec::new(), [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -11434,9 +11443,10 @@ pub mod api { "execute", types::Execute { proposal: ::std::boxed::Box::new(proposal), length_bound }, [ - 82u8, 33u8, 81u8, 14u8, 129u8, 202u8, 159u8, 242u8, 26u8, 39u8, 183u8, - 107u8, 3u8, 249u8, 97u8, 213u8, 44u8, 211u8, 88u8, 166u8, 129u8, 138u8, - 14u8, 155u8, 172u8, 226u8, 188u8, 149u8, 130u8, 83u8, 249u8, 58u8, + 247u8, 245u8, 61u8, 237u8, 29u8, 207u8, 10u8, 13u8, 140u8, 129u8, + 130u8, 144u8, 10u8, 139u8, 81u8, 215u8, 36u8, 28u8, 134u8, 191u8, + 148u8, 253u8, 15u8, 228u8, 116u8, 214u8, 255u8, 135u8, 115u8, 46u8, + 207u8, 245u8, ], ) } @@ -11455,9 +11465,9 @@ pub mod api { length_bound, }, [ - 137u8, 11u8, 241u8, 252u8, 171u8, 92u8, 51u8, 111u8, 151u8, 116u8, - 119u8, 97u8, 166u8, 71u8, 151u8, 220u8, 95u8, 228u8, 247u8, 148u8, 3u8, - 182u8, 194u8, 112u8, 226u8, 0u8, 25u8, 68u8, 214u8, 36u8, 22u8, 121u8, + 54u8, 106u8, 90u8, 70u8, 119u8, 54u8, 11u8, 48u8, 37u8, 184u8, 0u8, + 72u8, 147u8, 49u8, 223u8, 241u8, 187u8, 10u8, 8u8, 32u8, 190u8, 207u8, + 170u8, 126u8, 68u8, 26u8, 36u8, 87u8, 65u8, 195u8, 156u8, 174u8, ], ) } @@ -11689,9 +11699,10 @@ pub mod api { "ProposalOf", vec![::subxt::storage::address::make_static_storage_map_key(_0.borrow())], [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -11709,9 +11720,10 @@ pub mod api { "ProposalOf", Vec::new(), [ - 116u8, 85u8, 151u8, 144u8, 95u8, 207u8, 107u8, 229u8, 19u8, 45u8, 90u8, - 172u8, 109u8, 173u8, 162u8, 200u8, 28u8, 94u8, 219u8, 191u8, 41u8, - 250u8, 21u8, 144u8, 37u8, 86u8, 50u8, 253u8, 13u8, 182u8, 44u8, 48u8, + 226u8, 215u8, 16u8, 187u8, 205u8, 159u8, 235u8, 205u8, 130u8, 0u8, + 143u8, 146u8, 190u8, 110u8, 203u8, 106u8, 2u8, 151u8, 186u8, 201u8, + 65u8, 158u8, 109u8, 173u8, 95u8, 173u8, 107u8, 241u8, 7u8, 134u8, + 141u8, 142u8, ], ) } @@ -12416,10 +12428,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 173u8, 49u8, 236u8, 25u8, 240u8, 8u8, 21u8, 15u8, 88u8, 254u8, 57u8, - 163u8, 206u8, 63u8, 217u8, 57u8, 40u8, 128u8, 190u8, 141u8, 241u8, - 114u8, 36u8, 144u8, 64u8, 207u8, 108u8, 24u8, 70u8, 232u8, 138u8, - 139u8, + 80u8, 134u8, 40u8, 68u8, 191u8, 64u8, 2u8, 76u8, 232u8, 63u8, 119u8, + 100u8, 108u8, 204u8, 35u8, 250u8, 94u8, 114u8, 237u8, 89u8, 15u8, + 134u8, 224u8, 79u8, 112u8, 200u8, 9u8, 69u8, 248u8, 47u8, 163u8, 25u8, ], ) } @@ -12462,10 +12473,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 252u8, 236u8, 79u8, 32u8, 159u8, 155u8, 206u8, 20u8, 52u8, 70u8, 233u8, - 224u8, 102u8, 47u8, 225u8, 150u8, 76u8, 145u8, 194u8, 118u8, 16u8, - 161u8, 194u8, 191u8, 20u8, 15u8, 216u8, 170u8, 189u8, 57u8, 40u8, - 158u8, + 44u8, 232u8, 185u8, 6u8, 249u8, 90u8, 227u8, 51u8, 49u8, 237u8, 98u8, + 53u8, 25u8, 104u8, 231u8, 164u8, 50u8, 232u8, 99u8, 247u8, 12u8, 76u8, + 163u8, 123u8, 86u8, 74u8, 1u8, 120u8, 20u8, 13u8, 200u8, 232u8, ], ) } @@ -12504,9 +12514,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 124u8, 78u8, 157u8, 130u8, 119u8, 55u8, 220u8, 62u8, 11u8, 137u8, - 100u8, 95u8, 85u8, 57u8, 34u8, 103u8, 152u8, 229u8, 252u8, 80u8, 39u8, - 233u8, 125u8, 130u8, 6u8, 76u8, 179u8, 64u8, 53u8, 53u8, 218u8, 176u8, + 46u8, 156u8, 216u8, 174u8, 122u8, 12u8, 232u8, 120u8, 61u8, 89u8, 65u8, + 236u8, 152u8, 183u8, 89u8, 86u8, 156u8, 184u8, 6u8, 229u8, 27u8, 37u8, + 138u8, 111u8, 60u8, 188u8, 154u8, 111u8, 42u8, 146u8, 247u8, 239u8, ], ) } @@ -12532,9 +12542,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 199u8, 189u8, 213u8, 130u8, 111u8, 54u8, 149u8, 8u8, 118u8, 244u8, - 28u8, 94u8, 20u8, 31u8, 40u8, 132u8, 222u8, 182u8, 222u8, 219u8, 207u8, - 61u8, 206u8, 157u8, 60u8, 247u8, 66u8, 241u8, 149u8, 41u8, 42u8, 218u8, + 208u8, 181u8, 114u8, 147u8, 71u8, 39u8, 88u8, 102u8, 75u8, 241u8, + 212u8, 123u8, 189u8, 161u8, 189u8, 217u8, 93u8, 249u8, 91u8, 101u8, + 84u8, 226u8, 78u8, 220u8, 134u8, 59u8, 23u8, 95u8, 49u8, 86u8, 99u8, + 39u8, ], ) } @@ -12947,10 +12958,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 61u8, 40u8, 152u8, 236u8, 169u8, 217u8, 49u8, 238u8, 243u8, 49u8, - 194u8, 109u8, 120u8, 232u8, 196u8, 45u8, 245u8, 197u8, 51u8, 118u8, - 255u8, 156u8, 179u8, 96u8, 45u8, 165u8, 180u8, 191u8, 255u8, 217u8, - 211u8, 80u8, + 159u8, 251u8, 135u8, 244u8, 59u8, 247u8, 213u8, 187u8, 156u8, 179u8, + 22u8, 41u8, 38u8, 41u8, 78u8, 208u8, 149u8, 9u8, 218u8, 57u8, 154u8, + 121u8, 116u8, 80u8, 145u8, 57u8, 183u8, 19u8, 80u8, 79u8, 59u8, 32u8, ], ) } @@ -12964,9 +12974,9 @@ pub mod api { "as_derivative", types::AsDerivative { index, call: ::std::boxed::Box::new(call) }, [ - 40u8, 186u8, 52u8, 22u8, 230u8, 42u8, 224u8, 79u8, 78u8, 58u8, 17u8, - 141u8, 162u8, 124u8, 133u8, 55u8, 8u8, 151u8, 155u8, 129u8, 212u8, - 93u8, 143u8, 5u8, 7u8, 136u8, 186u8, 242u8, 157u8, 64u8, 90u8, 68u8, + 122u8, 246u8, 5u8, 47u8, 33u8, 20u8, 130u8, 76u8, 176u8, 254u8, 147u8, + 177u8, 188u8, 29u8, 125u8, 84u8, 134u8, 21u8, 240u8, 103u8, 34u8, + 255u8, 11u8, 164u8, 200u8, 119u8, 57u8, 44u8, 209u8, 72u8, 218u8, 17u8, ], ) } @@ -12979,9 +12989,10 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 92u8, 217u8, 79u8, 2u8, 151u8, 68u8, 215u8, 73u8, 117u8, 239u8, 51u8, - 91u8, 132u8, 82u8, 188u8, 126u8, 24u8, 42u8, 200u8, 229u8, 51u8, 54u8, - 158u8, 244u8, 143u8, 146u8, 186u8, 61u8, 129u8, 72u8, 35u8, 98u8, + 90u8, 21u8, 22u8, 169u8, 24u8, 7u8, 128u8, 56u8, 119u8, 71u8, 213u8, + 116u8, 149u8, 40u8, 222u8, 133u8, 171u8, 59u8, 76u8, 133u8, 168u8, + 84u8, 50u8, 116u8, 223u8, 133u8, 173u8, 119u8, 114u8, 172u8, 91u8, + 122u8, ], ) } @@ -12998,10 +13009,9 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 168u8, 200u8, 58u8, 83u8, 130u8, 130u8, 50u8, 117u8, 246u8, 153u8, - 126u8, 200u8, 195u8, 8u8, 201u8, 186u8, 152u8, 247u8, 137u8, 211u8, - 120u8, 181u8, 90u8, 31u8, 93u8, 18u8, 54u8, 39u8, 47u8, 235u8, 87u8, - 69u8, + 20u8, 117u8, 8u8, 94u8, 129u8, 58u8, 0u8, 81u8, 32u8, 176u8, 73u8, + 77u8, 158u8, 211u8, 130u8, 239u8, 153u8, 108u8, 183u8, 228u8, 76u8, + 177u8, 149u8, 50u8, 211u8, 62u8, 102u8, 170u8, 49u8, 93u8, 61u8, 179u8, ], ) } @@ -13014,9 +13024,9 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 196u8, 54u8, 102u8, 117u8, 36u8, 183u8, 148u8, 188u8, 110u8, 43u8, 6u8, - 238u8, 175u8, 233u8, 215u8, 197u8, 31u8, 54u8, 65u8, 198u8, 181u8, - 72u8, 201u8, 68u8, 120u8, 180u8, 119u8, 14u8, 212u8, 222u8, 30u8, 87u8, + 17u8, 161u8, 205u8, 242u8, 158u8, 124u8, 51u8, 44u8, 113u8, 113u8, + 13u8, 180u8, 96u8, 173u8, 158u8, 183u8, 158u8, 28u8, 11u8, 69u8, 7u8, + 7u8, 170u8, 71u8, 99u8, 66u8, 147u8, 130u8, 153u8, 140u8, 177u8, 90u8, ], ) } @@ -13030,9 +13040,10 @@ pub mod api { "with_weight", types::WithWeight { call: ::std::boxed::Box::new(call), weight }, [ - 144u8, 1u8, 37u8, 40u8, 106u8, 132u8, 67u8, 232u8, 104u8, 43u8, 217u8, - 104u8, 91u8, 123u8, 214u8, 20u8, 171u8, 225u8, 168u8, 233u8, 75u8, - 129u8, 132u8, 49u8, 6u8, 244u8, 99u8, 224u8, 146u8, 196u8, 94u8, 209u8, + 31u8, 99u8, 193u8, 11u8, 160u8, 141u8, 68u8, 106u8, 108u8, 141u8, + 178u8, 220u8, 129u8, 120u8, 131u8, 172u8, 170u8, 185u8, 183u8, 103u8, + 112u8, 240u8, 91u8, 52u8, 41u8, 8u8, 39u8, 226u8, 49u8, 85u8, 187u8, + 197u8, ], ) } @@ -13711,10 +13722,9 @@ pub mod api { "proxy", types::Proxy { real, force_proxy_type, call: ::std::boxed::Box::new(call) }, [ - 39u8, 100u8, 189u8, 154u8, 211u8, 110u8, 100u8, 144u8, 4u8, 48u8, - 181u8, 99u8, 7u8, 117u8, 230u8, 198u8, 150u8, 248u8, 74u8, 25u8, 154u8, - 235u8, 145u8, 37u8, 201u8, 219u8, 210u8, 185u8, 50u8, 225u8, 157u8, - 5u8, + 70u8, 22u8, 208u8, 172u8, 226u8, 208u8, 31u8, 50u8, 33u8, 170u8, 132u8, + 28u8, 14u8, 185u8, 105u8, 72u8, 144u8, 76u8, 228u8, 82u8, 239u8, 128u8, + 185u8, 89u8, 131u8, 12u8, 122u8, 192u8, 105u8, 4u8, 154u8, 121u8, ], ) } @@ -13896,9 +13906,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 201u8, 198u8, 215u8, 125u8, 123u8, 78u8, 20u8, 35u8, 99u8, 55u8, 127u8, - 121u8, 69u8, 112u8, 32u8, 109u8, 190u8, 88u8, 42u8, 252u8, 209u8, 3u8, - 110u8, 169u8, 181u8, 221u8, 120u8, 149u8, 86u8, 221u8, 75u8, 44u8, + 47u8, 207u8, 247u8, 31u8, 156u8, 52u8, 167u8, 200u8, 198u8, 69u8, + 224u8, 170u8, 161u8, 163u8, 138u8, 230u8, 157u8, 207u8, 97u8, 22u8, + 174u8, 25u8, 83u8, 68u8, 12u8, 145u8, 139u8, 158u8, 189u8, 196u8, 28u8, + 108u8, ], ) } @@ -19331,6 +19342,57 @@ pub mod api { const PALLET: &'static str = "Assets"; const CALL: &'static str = "burn_from"; } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ForceTransferAll { + pub asset: runtime_types::primitives::currency::CurrencyId, + pub source: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + pub dest: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + pub keep_alive: ::core::primitive::bool, + } + impl ::subxt::blocks::StaticExtrinsic for ForceTransferAll { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_transfer_all"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + :: subxt :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + # [codec (crate = :: subxt :: ext :: codec)] + #[decode_as_type(crate_path = ":: subxt :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: scale_encode")] + pub struct ForceTransferAllNative { + pub source: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + pub dest: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + pub keep_alive: ::core::primitive::bool, + } + impl ::subxt::blocks::StaticExtrinsic for ForceTransferAllNative { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_transfer_all_native"; + } } pub struct TransactionApi; impl TransactionApi { @@ -19553,6 +19615,55 @@ pub mod api { ], ) } + pub fn force_transfer_all( + &self, + asset: runtime_types::primitives::currency::CurrencyId, + source: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + ) -> ::subxt::tx::Payload { + ::subxt::tx::Payload::new_static( + "Assets", + "force_transfer_all", + types::ForceTransferAll { asset, source, dest, keep_alive }, + [ + 162u8, 124u8, 238u8, 244u8, 254u8, 234u8, 198u8, 97u8, 203u8, 189u8, + 230u8, 17u8, 12u8, 149u8, 53u8, 237u8, 202u8, 144u8, 133u8, 154u8, + 145u8, 76u8, 127u8, 62u8, 116u8, 174u8, 68u8, 243u8, 93u8, 143u8, 2u8, + 27u8, + ], + ) + } + pub fn force_transfer_all_native( + &self, + source: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + ) -> ::subxt::tx::Payload { + ::subxt::tx::Payload::new_static( + "Assets", + "force_transfer_all_native", + types::ForceTransferAllNative { source, dest, keep_alive }, + [ + 88u8, 186u8, 220u8, 63u8, 24u8, 167u8, 150u8, 194u8, 235u8, 116u8, + 50u8, 57u8, 224u8, 0u8, 140u8, 230u8, 168u8, 11u8, 155u8, 106u8, 207u8, + 193u8, 56u8, 40u8, 175u8, 10u8, 101u8, 155u8, 222u8, 192u8, 17u8, + 204u8, + ], + ) + } } } pub mod constants { @@ -24156,9 +24267,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 206u8, 32u8, 113u8, 15u8, 238u8, 120u8, 96u8, 240u8, 143u8, 246u8, - 46u8, 250u8, 114u8, 9u8, 179u8, 51u8, 89u8, 238u8, 75u8, 240u8, 141u8, - 90u8, 8u8, 18u8, 171u8, 218u8, 222u8, 234u8, 109u8, 168u8, 31u8, 137u8, + 222u8, 23u8, 42u8, 220u8, 50u8, 97u8, 48u8, 85u8, 230u8, 190u8, 24u8, + 40u8, 78u8, 223u8, 180u8, 200u8, 65u8, 169u8, 145u8, 22u8, 133u8, + 110u8, 162u8, 133u8, 157u8, 120u8, 132u8, 121u8, 123u8, 103u8, 129u8, + 81u8, ], ) } @@ -33598,6 +33710,31 @@ pub mod api { #[codec(compact)] amount: ::core::primitive::u128, }, + #[codec(index = 10)] + force_transfer_all { + asset: runtime_types::primitives::currency::CurrencyId, + source: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + }, + #[codec(index = 11)] + force_transfer_all_native { + source: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::utils::MultiAddress< + ::subxt::utils::AccountId32, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + }, } #[derive( :: subxt :: ext :: codec :: Decode, From 212fe90ca576adfe00c165cb93a36938349b0539 Mon Sep 17 00:00:00 2001 From: Robert Jonczy Date: Tue, 21 May 2024 10:20:47 +0200 Subject: [PATCH 18/22] chore(ci): change trigger branch master -> main (#498) --- .github/workflows/checks.yml | 4 ++-- .github/workflows/hyperspace-docker-image.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/parachain-node-docker-image.yml | 4 ++-- .github/workflows/test.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2522afcd9..67efcc0e4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -3,12 +3,12 @@ name: Cargo Check on: pull_request: branches: - - 'master' + - 'main' - 'develop' - 'release*' push: branches: - - 'master' + - 'main' - 'develop' - 'release*' diff --git a/.github/workflows/hyperspace-docker-image.yml b/.github/workflows/hyperspace-docker-image.yml index 3c7768105..c2b0607aa 100644 --- a/.github/workflows/hyperspace-docker-image.yml +++ b/.github/workflows/hyperspace-docker-image.yml @@ -3,7 +3,7 @@ name: "Build and publish Hyperspace Docker image" on: push: branches: - - 'master' + - 'main' - 'develop' - 'release*' tags: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5ea372c9f..e6ebdbe2f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,12 +3,12 @@ name: Lint on: pull_request: branches: - - 'master' + - 'main' - 'develop' - 'release*' push: branches: - - 'master' + - 'main' - 'develop' - 'release*' diff --git a/.github/workflows/parachain-node-docker-image.yml b/.github/workflows/parachain-node-docker-image.yml index 988666358..384ffe307 100644 --- a/.github/workflows/parachain-node-docker-image.yml +++ b/.github/workflows/parachain-node-docker-image.yml @@ -1,4 +1,4 @@ -# This workflow pushes new parachain-node docker images on every new push on master. +# This workflow pushes new parachain-node docker images on every new push on main. # # All the images above have support for linux/amd64 and linux/arm64. # @@ -9,7 +9,7 @@ name: "Build and publish Parachain-node Docker image" on: push: branches: - - master + - main jobs: build-and-publish: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 974f0e708..3b22e7cbb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Test on: push: branches: - - 'master' + - 'main' - 'release*' env: From 9d40863f76a26828e9781cca672ba8445bf6c4ee Mon Sep 17 00:00:00 2001 From: Kien Date: Tue, 21 May 2024 22:38:05 +0700 Subject: [PATCH 19/22] feat(grandpa): expose migrate entry point (#499) * feat(grandpa): expose migrate entry point * chore: remote ununsed instantiate interface file --- Cargo.lock | 4 ++-- light-clients/ics10-grandpa-cw/src/contract.rs | 10 ++++++++-- light-clients/ics10-grandpa-cw/src/msg.rs | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3209a3d0..116e5a24c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1160,9 +1160,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" dependencies = [ "smallvec", ] diff --git a/light-clients/ics10-grandpa-cw/src/contract.rs b/light-clients/ics10-grandpa-cw/src/contract.rs index bb1c49cad..685ff14dd 100644 --- a/light-clients/ics10-grandpa-cw/src/contract.rs +++ b/light-clients/ics10-grandpa-cw/src/contract.rs @@ -20,8 +20,8 @@ use crate::{ msg::{ CheckForMisbehaviourMsg, CheckSubstituteAndUpdateStateMsg, ContractResult, ExecuteMsg, ExportMetadataMsg, InstantiateMsg, QueryMsg, QueryResponse, StatusMsg, UpdateStateMsg, - UpdateStateOnMisbehaviourMsg, VerifyClientMessage, VerifyMembershipMsg, - VerifyNonMembershipMsg, VerifyUpgradeAndUpdateStateMsg, + UpdateStateOnMisbehaviourMsg, VerifyClientMessage, VerifyMembershipMsg, MigrateMsg, + VerifyNonMembershipMsg, VerifyUpgradeAndUpdateStateMsg }, state::{get_client_state, get_consensus_state}, Bytes, @@ -113,6 +113,12 @@ impl grandpa_light_client_primitives::HostFunctions for HostFunctions { } } +#[entry_point] +pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { + // No state migrations performed, just returned a Response + Ok(Response::default()) +} + #[cfg_attr(not(feature = "library"), entry_point)] pub fn instantiate( _deps: DepsMut, diff --git a/light-clients/ics10-grandpa-cw/src/msg.rs b/light-clients/ics10-grandpa-cw/src/msg.rs index 0aea7b7eb..5a02f9df9 100644 --- a/light-clients/ics10-grandpa-cw/src/msg.rs +++ b/light-clients/ics10-grandpa-cw/src/msg.rs @@ -109,6 +109,9 @@ pub struct ClientStateCallResponse { pub result: ContractResult, } +#[cw_serde] +pub struct MigrateMsg {} + #[cw_serde] pub struct InstantiateMsg {} From cb1d5f096f85efdc7cc289444fa7131b3074ec04 Mon Sep 17 00:00:00 2001 From: Robert Jonczy Date: Wed, 22 May 2024 10:27:25 +0200 Subject: [PATCH 20/22] chore(ci): added release action (#500) added release action --- .github/workflows/release.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..2fc23668f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: Release + +on: + push: + tags: + - "v*.*.*" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true \ No newline at end of file From 9315a7b4d1cdd2a6c6de96f20d828a52228a2c48 Mon Sep 17 00:00:00 2001 From: Vladislav Markushin Date: Wed, 7 Aug 2024 23:32:01 -0300 Subject: [PATCH 21/22] Revert some changes from `main` --- .github/workflows/checks.yml | 4 +- .github/workflows/hyperspace-docker-image.yml | 2 +- .../workflows/parachain-node-docker-image.yml | 4 +- .github/workflows/release.yml | 17 ----- .github/workflows/test.yml | 2 +- Cargo.lock | 66 ++++++++++++------- .../ics10-grandpa-cw/src/contract.rs | 21 ++++-- light-clients/ics10-grandpa-cw/src/msg.rs | 3 - 8 files changed, 65 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 02d9c74a0..7315f15b0 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -3,12 +3,12 @@ name: Cargo Check on: pull_request: branches: - - 'main' + - 'master' - 'develop' - 'release*' push: branches: - - 'main' + - 'master' - 'develop' - 'release*' diff --git a/.github/workflows/hyperspace-docker-image.yml b/.github/workflows/hyperspace-docker-image.yml index c2b0607aa..3c7768105 100644 --- a/.github/workflows/hyperspace-docker-image.yml +++ b/.github/workflows/hyperspace-docker-image.yml @@ -3,7 +3,7 @@ name: "Build and publish Hyperspace Docker image" on: push: branches: - - 'main' + - 'master' - 'develop' - 'release*' tags: diff --git a/.github/workflows/parachain-node-docker-image.yml b/.github/workflows/parachain-node-docker-image.yml index 384ffe307..988666358 100644 --- a/.github/workflows/parachain-node-docker-image.yml +++ b/.github/workflows/parachain-node-docker-image.yml @@ -1,4 +1,4 @@ -# This workflow pushes new parachain-node docker images on every new push on main. +# This workflow pushes new parachain-node docker images on every new push on master. # # All the images above have support for linux/amd64 and linux/arm64. # @@ -9,7 +9,7 @@ name: "Build and publish Parachain-node Docker image" on: push: branches: - - main + - master jobs: build-and-publish: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 2fc23668f..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*.*.*" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Release - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b22e7cbb..974f0e708 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Test on: push: branches: - - 'main' + - 'master' - 'release*' env: diff --git a/Cargo.lock b/Cargo.lock index 67eb577f1..4fc8b634a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,15 +214,16 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] @@ -1396,23 +1397,23 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", - "clap_derive 4.4.2", + "clap_derive 4.4.7", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", - "clap_lex 0.5.1", + "clap_lex 0.6.0", "strsim", ] @@ -1440,9 +1441,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -1461,9 +1462,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "coarsetime" @@ -1482,7 +1483,7 @@ name = "codegen" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.23", + "clap 4.4.18", "frame-metadata 15.1.0", "hex", "http 0.2.9", @@ -2016,7 +2017,7 @@ name = "cumulus-client-cli" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "parity-scale-codec", "sc-chain-spec", "sc-cli", @@ -3619,7 +3620,7 @@ dependencies = [ "Inflector", "array-bytes 4.2.0", "chrono", - "clap 4.4.6", + "clap 4.4.18", "comfy-table", "frame-benchmarking", "frame-support", @@ -4698,7 +4699,7 @@ name = "hyperspace" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.23", + "clap 4.4.18", "hyperspace-core", "tokio", "toml 0.7.6", @@ -4710,7 +4711,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "clap 3.2.23", + "clap 4.4.18", "codegen", "derive_more", "env_logger 0.9.3", @@ -4719,6 +4720,7 @@ dependencies = [ "futures", "hex", "hyperspace-cosmos", + "hyperspace-macros", "hyperspace-metrics", "hyperspace-parachain", "hyperspace-primitives", @@ -4802,6 +4804,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hyperspace-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "hyperspace-metrics" version = "0.1.0" @@ -4827,7 +4838,7 @@ dependencies = [ "beefy-light-client", "beefy-light-client-primitives", "beefy-prover", - "clap 3.2.23", + "clap 4.4.18", "derive_more", "finality-grandpa", "frame-support", @@ -5580,6 +5591,7 @@ name = "ibc-rpc" version = "0.1.0" dependencies = [ "frame-system", + "hex", "ibc 0.15.0", "ibc-derive 0.1.0", "ibc-primitives 0.1.0", @@ -6129,6 +6141,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -9166,7 +9184,7 @@ dependencies = [ name = "parachain-node" version = "0.1.0" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -9710,7 +9728,7 @@ name = "polkadot-cli" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "frame-benchmarking-cli", "futures", "log", @@ -12194,7 +12212,7 @@ source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9. dependencies = [ "array-bytes 4.2.0", "chrono", - "clap 4.4.6", + "clap 4.4.18", "fdlimit", "futures", "libp2p-identity", @@ -13045,7 +13063,7 @@ name = "sc-storage-monitor" version = "0.1.0" source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "fs4", "futures", "log", @@ -16448,7 +16466,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "clap 4.4.6", + "clap 4.4.18", "frame-remote-externalities", "hex", "log", @@ -16551,7 +16569,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.7", "rand 0.8.5", "static_assertions", diff --git a/light-clients/ics10-grandpa-cw/src/contract.rs b/light-clients/ics10-grandpa-cw/src/contract.rs index 0d5f9cb5f..cb1919635 100644 --- a/light-clients/ics10-grandpa-cw/src/contract.rs +++ b/light-clients/ics10-grandpa-cw/src/contract.rs @@ -118,10 +118,23 @@ impl grandpa_light_client_primitives::HostFunctions for HostFunctions { } } -#[entry_point] -pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { - // No state migrations performed, just returned a Response - Ok(Response::default()) +fn process_instantiate_msg( + msg: InstantiateMessage, + ctx: &mut Context, + client_id: ClientId, +) -> Result { + let any = Any::decode(&mut msg.client_state.as_slice())?; + let client_state = ClientState::decode_vec(&any.value)?; + let any = Any::decode(&mut msg.consensus_state.as_slice())?; + let consensus_state = ConsensusState::decode_vec(&any.value)?; + + let height = client_state.latest_height(); + ctx.checksum = Some(msg.checksum); + ctx.store_client_state(client_id.clone(), client_state) + .map_err(|e| ContractError::Grandpa(e.to_string()))?; + ctx.store_consensus_state(client_id, height, consensus_state) + .map_err(|e| ContractError::Grandpa(e.to_string()))?; + Ok(to_binary(&ContractResult::success())?) } #[cfg_attr(not(feature = "library"), entry_point)] diff --git a/light-clients/ics10-grandpa-cw/src/msg.rs b/light-clients/ics10-grandpa-cw/src/msg.rs index b76b8aee9..13d7d0c99 100644 --- a/light-clients/ics10-grandpa-cw/src/msg.rs +++ b/light-clients/ics10-grandpa-cw/src/msg.rs @@ -127,9 +127,6 @@ pub struct ClientStateCallResponse { pub result: ContractResult, } -#[cw_serde] -pub struct MigrateMsg {} - #[cw_serde] pub struct InitializeState { pub client_state: WasmClientState, From 5b37365a7d0d1556a2f41b6f3bf06276f476e12e Mon Sep 17 00:00:00 2001 From: Sventimir Date: Thu, 8 Aug 2024 14:47:24 +0200 Subject: [PATCH 22/22] Allow config files to be specified anywhere in the command. Sadly, we need to work around clap's limitations to do it, which results in suboptmial error messages if these arguments are missing. Basically we pretend to clap that they're optional and check if they're provided manually. --- hyperspace/core/src/command.rs | 56 ++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/hyperspace/core/src/command.rs b/hyperspace/core/src/command.rs index d03b59322..88e884bb6 100644 --- a/hyperspace/core/src/command.rs +++ b/hyperspace/core/src/command.rs @@ -64,34 +64,42 @@ pub enum Subcommand { }, } +/* Notice that config_a, config_b and config_core are optional below, + even though we consider them mandatory. This is due to limitations + of clap, which does not allow mandatory arguments to be global. + Being local, they would have to occur immediately after query + subcommand, which is not very user-friendly. For this reason we + tell clap they're optional and raise an error later if they are not + provided. +*/ #[derive(Debug, Clone, Parser)] pub struct Cmd { - /// Relayer chain A config path. - #[clap(long)] - pub config_a: String, - /// Relayer chain B config path. - #[clap(long)] - config_b: String, - /// Relayer core config path. - #[clap(long)] - config_core: String, + /// Relayer chain A config path (madatory). + #[clap(long, global = true)] + pub config_a: Option, + /// Relayer chain B config path (mandatory). + #[clap(long, global = true)] + config_b: Option, + /// Relayer core config path (mandatory). + #[clap(long, global = true)] + config_core: Option, /// Port id for channel creation - #[clap(long)] + #[clap(long, global = true)] port_id: Option, /// Connection delay period in seconds - #[clap(long)] + #[clap(long, global = true)] delay_period: Option, /// Channel order - #[clap(long)] + #[clap(long, global = true)] order: Option, /// Channel version - #[clap(long)] + #[clap(long, global = true)] version: Option, /// New config path for A to avoid overriding existing configuration - #[clap(long)] + #[clap(long, global = true)] pub out_config_a: Option, /// New config path for B to avoid overriding existing configuration - #[clap(long)] + #[clap(long, global = true)] pub out_config_b: Option, } @@ -132,9 +140,15 @@ impl UploadWasmCmd { impl Cmd { pub async fn parse_config(&self) -> Result { use tokio::fs::read_to_string; - let path_a: PathBuf = self.config_a.parse()?; - let path_b: PathBuf = self.config_b.parse()?; - let path_core: PathBuf = self.config_core.parse()?; + let config_a_opt = + self.config_a.clone().ok_or(anyhow::anyhow!("--config-a is mandatory"))?; + let path_a: PathBuf = config_a_opt.parse()?; + let config_b_opt = + self.config_b.clone().ok_or(anyhow::anyhow!("--config-b is mandatory"))?; + let path_b: PathBuf = config_b_opt.parse()?; + let config_core_opt = + self.config_core.clone().ok_or(anyhow::anyhow!("--config-core is mandatory"))?; + let path_core: PathBuf = config_core_opt.parse()?; let file_content = read_to_string(path_a).await?; let config_a: AnyConfig = toml::from_str(&file_content)?; let file_content = read_to_string(path_b).await?; @@ -279,8 +293,10 @@ impl Cmd { } pub async fn save_config(&self, new_config: &Config) -> Result<()> { - let path_a = self.out_config_a.as_ref().cloned().unwrap_or_else(|| self.config_a.clone()); - let path_b = self.out_config_b.as_ref().cloned().unwrap_or_else(|| self.config_b.clone()); + let path_a = self.out_config_a.as_ref().cloned().or_else(|| self.config_a.clone()) + .ok_or(anyhow::anyhow!("--config-a is mandatory"))?; + let path_b = self.out_config_b.as_ref().cloned().or_else(|| self.config_b.clone()) + .ok_or(anyhow::anyhow!("--config-b is mandatory"))?; write_config(path_a, &new_config.chain_a).await?; write_config(path_b, &new_config.chain_b).await }