From ec3c10ef12870b5ef90435589ac95d2b9fd59fb7 Mon Sep 17 00:00:00 2001 From: Filip Date: Fri, 7 Jul 2023 18:05:59 +0200 Subject: [PATCH] v0.1.1 --- build.rs | 11 ++ examples/examples/block_events.rs | 10 ++ examples/examples/decode_extrinsics.rs | 10 ++ examples/examples/get_block_events.rs | 10 ++ .../get_pallet_storagemaps_storagevalues.rs | 11 +- examples/examples/get_pallets_test.rs | 10 ++ examples/examples/metadata_version.rs | 11 ++ examples/examples/sample_test_rnu.rs | 10 ++ examples/examples/schedule_check.rs | 10 ++ examples/examples/subscribe_latest_blocks.rs | 10 ++ examples/examples/upgrade_change_diff.rs | 12 +- libuptest/src/codec.rs | 166 ++---------------- libuptest/src/decode_extrinsic.rs | 14 +- libuptest/src/error.rs | 16 +- libuptest/src/jsonrpseeclient/mod.rs | 11 ++ libuptest/src/jsonrpseeclient/subscription.rs | 12 ++ libuptest/src/lib.rs | 11 ++ libuptest/src/metadata.rs | 11 ++ libuptest/src/pallet_storage_parse.rs | 11 ++ libuptest/src/subxt_helper.rs | 11 ++ libuptest/src/types.rs | 34 +++- libuptest/src/ws_mod.rs | 11 ++ src/build.rs | 11 ++ src/cli.rs | 10 ++ src/helper.rs | 11 ++ src/main.rs | 10 ++ src/mod.rs | 10 ++ 27 files changed, 311 insertions(+), 164 deletions(-) diff --git a/build.rs b/build.rs index 3b01df9..d5d85d4 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + // Build mandoc use std::fs; diff --git a/examples/examples/block_events.rs b/examples/examples/block_events.rs index a30a52e..1fad672 100644 --- a/examples/examples/block_events.rs +++ b/examples/examples/block_events.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ use libuptest::jsonrpseeclient::JsonrpseeClient; use libuptest::types::{PreBlock, H256}; use libuptest::ws_mod::get_block_events; diff --git a/examples/examples/decode_extrinsics.rs b/examples/examples/decode_extrinsics.rs index c3bd53f..261a8ff 100644 --- a/examples/examples/decode_extrinsics.rs +++ b/examples/examples/decode_extrinsics.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ use libuptest::decode_extrinsic::decode_extrinsic_hex_string; use libuptest::jsonrpseeclient::JsonrpseeClient; use libuptest::types::event_summary; diff --git a/examples/examples/get_block_events.rs b/examples/examples/get_block_events.rs index a111f1a..ad3d025 100644 --- a/examples/examples/get_block_events.rs +++ b/examples/examples/get_block_events.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ /// get the block events from the latest block and return the block events, decoded extrinsics use libuptest::decode_extrinsic::{decode_extrinsic_hex_string, decodec_to_event_summary}; use libuptest::jsonrpseeclient::subscription::HandleSubscription; diff --git a/examples/examples/get_pallet_storagemaps_storagevalues.rs b/examples/examples/get_pallet_storagemaps_storagevalues.rs index 5b818de..423b782 100644 --- a/examples/examples/get_pallet_storagemaps_storagevalues.rs +++ b/examples/examples/get_pallet_storagemaps_storagevalues.rs @@ -1,6 +1,15 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ /// return information about the storage maps and storage values for all enabled pallets /// -/// use libuptest::jsonrpseeclient::JsonrpseeClient; use libuptest::pallet_storage_parse::{parse_pallet_storage_types, storage_map_info}; use libuptest::ws_mod::get_raw_metadata; diff --git a/examples/examples/get_pallets_test.rs b/examples/examples/get_pallets_test.rs index c036bea..246f380 100644 --- a/examples/examples/get_pallets_test.rs +++ b/examples/examples/get_pallets_test.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ use libuptest::jsonrpseeclient::JsonrpseeClient; use libuptest::types::H256; use libuptest::ws_mod::{get_latest_finalized_head, get_raw_metadata}; diff --git a/examples/examples/metadata_version.rs b/examples/examples/metadata_version.rs index ea4e708..bb4e86c 100644 --- a/examples/examples/metadata_version.rs +++ b/examples/examples/metadata_version.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + // get the metadata version of the chain use libuptest::jsonrpseeclient::JsonrpseeClient; diff --git a/examples/examples/sample_test_rnu.rs b/examples/examples/sample_test_rnu.rs index 9a3909b..4feed3f 100644 --- a/examples/examples/sample_test_rnu.rs +++ b/examples/examples/sample_test_rnu.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ /// get the block events from the latest block and return the block events, decoded extrinsics use libuptest::decode_extrinsic::{decode_extrinsic_hex_string, decodec_to_event_summary}; use libuptest::jsonrpseeclient::{JsonrpseeClient, RpcParams}; diff --git a/examples/examples/schedule_check.rs b/examples/examples/schedule_check.rs index c43f524..87f2db9 100644 --- a/examples/examples/schedule_check.rs +++ b/examples/examples/schedule_check.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ use libuptest::jsonrpseeclient::JsonrpseeClient; use libuptest::types::{event_summary, H256}; use libuptest::ws_mod::event_watch; diff --git a/examples/examples/subscribe_latest_blocks.rs b/examples/examples/subscribe_latest_blocks.rs index e404561..f7a588d 100644 --- a/examples/examples/subscribe_latest_blocks.rs +++ b/examples/examples/subscribe_latest_blocks.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ // subscribe to latest blocks, this is only in dev stage, on the way to moving it a better impl use libuptest::jsonrpseeclient::subscription::HandleSubscription; diff --git a/examples/examples/upgrade_change_diff.rs b/examples/examples/upgrade_change_diff.rs index e38271c..e78679c 100644 --- a/examples/examples/upgrade_change_diff.rs +++ b/examples/examples/upgrade_change_diff.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + /// get a diff of storage items that have changed during a runtime upgrade use libuptest::jsonrpseeclient::JsonrpseeClient; use libuptest::types::{event_summary, H256}; @@ -84,7 +95,6 @@ async fn main() -> anyhow::Result<(), libuptest::error::Error> { ); } - println!("All good"); Ok(()) } diff --git a/libuptest/src/codec.rs b/libuptest/src/codec.rs index 788ec0a..8f24d60 100644 --- a/libuptest/src/codec.rs +++ b/libuptest/src/codec.rs @@ -1,33 +1,24 @@ -use crate::error::ErrorEvent; -//use crate::types::H256; -use serde::{Deserialize, Serialize}; - -//use crate::error::Error; /* -pub fn decode_char(data: &[u8], indent: u32) -> anhow::Result { - let mut slice_to_char = data.get(0..4).ok_or(ParserDecodingError::DataTooShort)?; - let a = ::decode(&mut slice_to_char) - .map_err(|_| ParserDecodingError::PrimitiveFailure("char".to_string()))?; - let b = char::from_u32(a) - .ok_or_else(|| ParserDecodingError::PrimitiveFailure("char".to_string()))?; - let fancy_out = vec![OutputCard { - card: ParserCard::Default(b.to_string()), - indent, - }]; - let remaining_vector = (data[4..]).to_vec(); - Ok(DecodedOut { - remaining_vector, - fancy_out, - }) -} +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +use crate::error::ErrorEvent; +use serde::{Deserialize, Serialize}; + +/// runtime Version containing a spec version #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct RuntimeVersionEvent { /// The runtime version. pub spec: u32, } - +/// Runtime event, returning a spec_version if value, if not error #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] #[serde(tag = "type")] @@ -37,134 +28,3 @@ pub enum RuntimeEvent { /// The runtime could not be obtained due to an error. Invalid(ErrorEvent), } - -/* -#[derive(Clone)] -pub enum ParserCard { - Pallet(String), // pallet name - Method { - method_name: String, - docs: String, - }, - Varname(String), - Default(String), - Text(String), - Id { - id: AccountId32, - base58prefix: u16, - }, - Id20 { - id: [u8; 20], - base58prefix: u16, - }, - None, - IdentityField(String), - BitVec(String), // String from printing `BitVec` - Balance { - number: String, - units: String, - }, - FieldName { - name: String, - docs_field_name: String, - path_type: String, - docs_type: String, - }, - FieldNumber { - number: usize, - docs_field_number: String, - path_type: String, - docs_type: String, - }, - EnumVariantName { - name: String, - docs_enum_variant: String, - }, - Era(Era), - Nonce(String), - BlockHash(H256), - Tip { - number: String, - units: String, - }, - NetworkNameVersion { - name: String, - version: String, - }, - TxVersion(String), -} - -impl ParserCard { - pub fn show_no_docs(&self, indent: u32) -> String { - match &self { - ParserCard::Pallet(pallet_name) => readable(indent, "pallet", pallet_name), - ParserCard::Method { - method_name, - docs: _, - } => readable(indent, "method", method_name), - ParserCard::Varname(varname) => readable(indent, "varname", varname), - ParserCard::Default(decoded_string) => readable(indent, "default", decoded_string), - ParserCard::Text(decoded_text) => readable(indent, "text", decoded_text), - ParserCard::Id { id, base58prefix } => readable( - indent, - "Id", - &id.to_ss58check_with_version(Ss58AddressFormat::custom(*base58prefix)), - ), - ParserCard::Id20 { - id, - base58prefix: _, - } => readable(indent, "Id", &format!("0x{}", hex::encode(id))), - ParserCard::None => readable(indent, "none", ""), - ParserCard::IdentityField(variant) => readable(indent, "identity_field", variant), - ParserCard::BitVec(bv) => readable(indent, "bitvec", bv), - ParserCard::Balance { number, units } => { - readable(indent, "balance", &format!("{number} {units}")) - } - ParserCard::FieldName { - name, - docs_field_name: _, - path_type: _, - docs_type: _, - } => readable(indent, "field_name", name), - ParserCard::FieldNumber { - number, - docs_field_number: _, - path_type: _, - docs_type: _, - } => readable(indent, "field_number", &number.to_string()), - ParserCard::EnumVariantName { - name, - docs_enum_variant: _, - } => readable(indent, "enum_variant_name", name), - ParserCard::Era(era) => match era { - Era::Immortal => readable(indent, "era", "Immortal"), - Era::Mortal(period, phase) => readable( - indent, - "era", - &format!("Mortal, phase: {phase}, period: {period}"), - ), - }, - ParserCard::Nonce(nonce) => readable(indent, "nonce", nonce), - ParserCard::BlockHash(block_hash) => { - readable(indent, "block_hash", &hex::encode(block_hash)) - } - ParserCard::Tip { number, units } => { - readable(indent, "tip", &format!("{number} {units}")) - } - ParserCard::NetworkNameVersion { name, version } => { - readable(indent, "network", &format!("{name}{version}")) - } - ParserCard::TxVersion(x) => readable(indent, "tx_version", x), - } - } -} - -fn readable(indent: u32, card_type: &str, card_payload: &str) -> String { - format!( - "{}{}: {}", - " ".repeat(indent as usize), - card_type, - card_payload - ) -} -*/ diff --git a/libuptest/src/decode_extrinsic.rs b/libuptest/src/decode_extrinsic.rs index 7964194..2b29ced 100644 --- a/libuptest/src/decode_extrinsic.rs +++ b/libuptest/src/decode_extrinsic.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + #[cfg(feature = "metadatadecode")] // using desub from parity atm to decode extrinsics and manage the encodements use desub_current::{ @@ -8,6 +19,7 @@ use desub_current::{ use crate::types::{event_summary, pallet_storage_types}; +/// take a string, decode it as a Vec<> of u8 #[cfg(feature = "metadatadecode")] fn to_bytes(hex_str: &str) -> Vec { let hex_str = hex_str @@ -16,9 +28,9 @@ fn to_bytes(hex_str: &str) -> Vec { hex::decode(hex_str).expect("valid bytes from hex") } +/// decode a raw extrinsic hex string, take the chains metadata as input #[cfg(feature = "metadatadecode")] pub fn decode_extrinsic_hex_string<'a>(hexstring: &str, metadatablob: &[u8]) -> Extrinsic<'a> { - // let jsoninstance = JsonrpseeClient let metadata_polkadot_scale: &[u8] = metadatablob; let ext_bytes = &mut &*to_bytes(hexstring); let metadata: Metadata = Metadata::from_bytes(metadata_polkadot_scale).expect("valid metadata"); diff --git a/libuptest/src/error.rs b/libuptest/src/error.rs index 4f0b645..706a34f 100644 --- a/libuptest/src/error.rs +++ b/libuptest/src/error.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + extern crate alloc; use alloc::{boxed::Box, string::String}; @@ -7,6 +18,7 @@ use serde::{Deserialize, Serialize}; //boxed::Box, #[derive(Debug)] pub enum Error { + /// Serde Json error SerdeJson(serde_json::error::Error), MpscSend(String), InvalidUrl(String), @@ -29,7 +41,9 @@ pub enum Error { ConnectionHandshakefailed, /// could not remove connection subscription Unsubscribefail, + /// Could not get next item in async loop AsyncNextError, + /// Could not establish a subscription connection ConnectionSubscriptionProblem, Client(Box), } @@ -37,7 +51,6 @@ pub enum Error { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct ErrorEvent { - /// Reason of the error. pub error: String, } @@ -67,7 +80,6 @@ impl From for Error { } } -// impl From<&dyn std::error::Error> for Error { fn from(error: &dyn std::error::Error) -> Self { Self::Stderror(format!("{error:?}")) diff --git a/libuptest/src/jsonrpseeclient/mod.rs b/libuptest/src/jsonrpseeclient/mod.rs index 65551df..493e4c7 100644 --- a/libuptest/src/jsonrpseeclient/mod.rs +++ b/libuptest/src/jsonrpseeclient/mod.rs @@ -12,6 +12,17 @@ See the License for the specific language governing permissions and limitations under the License. */ +/* +Modified by: +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ use crate::error::Error; // {Error, Request, Result, RpcParams, Subscribe}; use futures::executor::block_on; diff --git a/libuptest/src/jsonrpseeclient/subscription.rs b/libuptest/src/jsonrpseeclient/subscription.rs index 855ad37..8b8fb2f 100644 --- a/libuptest/src/jsonrpseeclient/subscription.rs +++ b/libuptest/src/jsonrpseeclient/subscription.rs @@ -1,4 +1,5 @@ /* +based on: Copyright 2019 Supercomputing Systems AG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -10,6 +11,17 @@ See the License for the specific language governing permissions and limitations under the License. */ +/* +Modified by: +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ extern crate alloc; use crate::error::Error; //rpc::{, HandleSubscription, Result}; diff --git a/libuptest/src/lib.rs b/libuptest/src/lib.rs index 801a509..5b54de5 100644 --- a/libuptest/src/lib.rs +++ b/libuptest/src/lib.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + #![feature(error_in_core)] mod chains; // depricate me diff --git a/libuptest/src/metadata.rs b/libuptest/src/metadata.rs index 0585b76..ea68f23 100644 --- a/libuptest/src/metadata.rs +++ b/libuptest/src/metadata.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + /// for metadata v11 - v14 /// use std::path::Path; // no_std, well.... diff --git a/libuptest/src/pallet_storage_parse.rs b/libuptest/src/pallet_storage_parse.rs index 65022d2..1b14e8c 100644 --- a/libuptest/src/pallet_storage_parse.rs +++ b/libuptest/src/pallet_storage_parse.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + use crate::types::storage_types; /// parse the storage values and storage maps associated with all the pallets use desub_current::scale_info::TypeDefPrimitive; diff --git a/libuptest/src/subxt_helper.rs b/libuptest/src/subxt_helper.rs index 831bffa..ec0119c 100644 --- a/libuptest/src/subxt_helper.rs +++ b/libuptest/src/subxt_helper.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + /// schedule a subxt transaction to happen before or after a user defined event is triggered use subxt; diff --git a/libuptest/src/types.rs b/libuptest/src/types.rs index 9d838ce..f5cae70 100644 --- a/libuptest/src/types.rs +++ b/libuptest/src/types.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + use fixed_hash::construct_fixed_hash; use jsonrpsee_core::Cow; use serde::{Deserialize, Serialize}; @@ -17,19 +28,24 @@ impl H256 { */ } -/// todo add the cargo expand - +/// Block Header containing the block nr #[derive(Debug, Deserialize)] pub struct Header { pub number: String, } +/// Create a generic event in the form of: +/// event_summary { +/// pub pallet_name: "Sudo".to_string(), +/// pub pallet_method: "secret_function".to_string(), +/// } #[derive(Debug, PartialEq)] pub struct event_summary { pub pallet_name: String, pub pallet_method: String, } +/// enum for defining what type of storage entry it is, is it a StorageValue, StorageMap or Unknown type #[derive(Debug, PartialEq)] pub enum storage_types { /// Substrate StorageValue @@ -40,20 +56,23 @@ pub enum storage_types { Unknown, } +/// storage value #[derive(Debug, Clone)] -// storage value of pallet, could for example be StorageMap<> pub struct storage_value { name: String, - // storagetype: ,// tricky.. typeid: u32, } // wip, parse the pallets storage types, storage values and storage maps #[derive(Debug)] pub struct pallet_storage_types { + /// name of pallet pub pallet_prefix: String, + /// StorageMap|StorageValue or unknown pub StorageType: storage_types, + /// Vec of storage types pub storage_items: Vec, + /// the type id of the storage item pub type_id: u32, // type id of storage{Value/Map} } @@ -131,12 +150,14 @@ mod apis_serialize { } } +/// [u8; 8] pub type ApiId = [u8; 8]; /// A vector of pairs of `ApiId` and a `u32` for version. pub type ApisVec = Cow<'static, [(ApiId, u32)]>; -// https://github.com/paritytech/substrate/blob/0cf64f8bd72d719818be2f109c0919c7c9325cd1/primitives/version/src/lib.rs#L161 +/// RuntimeVersion ported over from substrate main repo +/// https://github.com/paritytech/substrate/blob/0cf64f8bd72d719818be2f109c0919c7c9325cd1/primitives/version/src/lib.rs#L161 #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] pub struct RuntimeVersion { @@ -164,7 +185,7 @@ pub struct Block { #[derive(Debug, Clone, PartialEq, Eq, Deserialize)] pub struct justifications(Vec); -// what we get if +// A generic PreBlock that contains a block and the justifications #[derive(Debug, Deserialize)] pub struct PreBlock { pub block: generic_block, @@ -172,4 +193,5 @@ pub struct PreBlock { pub justifications: Option, //Justification can be null so lets put this in an option } +/// A generic block format pub type generic_block = Block>; diff --git a/libuptest/src/ws_mod.rs b/libuptest/src/ws_mod.rs index 1b89287..464cc9c 100644 --- a/libuptest/src/ws_mod.rs +++ b/libuptest/src/ws_mod.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + pub use jsonrpsee::ws_client::{WsClient, WsClientBuilder}; //use crate::error; //use crate::jsonrpseeclient::rpcstuff::*; diff --git a/src/build.rs b/src/build.rs index c5d0f99..0971e3f 100644 --- a/src/build.rs +++ b/src/build.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + /// Build mandoc mod cli; diff --git a/src/cli.rs b/src/cli.rs index f3664eb..e0ef3ea 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ // cli use clap::{arg, Command}; diff --git a/src/helper.rs b/src/helper.rs index 7cac293..37e4988 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -1,3 +1,14 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + use libuptest::decode_extrinsic::{decode_extrinsic_hex_string, decodec_to_event_summary}; use libuptest::jsonrpseeclient::subscription::Subscribe; use libuptest::jsonrpseeclient::subscription::{HandleSubscription, Request}; diff --git a/src/main.rs b/src/main.rs index defc572..22e26aa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ // Uptest --chain X --wshost ws://host:port --pallet-test scheduler --sudo "seed goes here" use clap::ArgMatches; diff --git a/src/mod.rs b/src/mod.rs index fc57eae..d06db8c 100644 --- a/src/mod.rs +++ b/src/mod.rs @@ -1,3 +1,13 @@ +/* +Copyright © 2023 Rust Syndicate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ pub mod cli; use libuptest::jsonrpseeclient::subscription::HandleSubscription;