Skip to content

Commit

Permalink
Fix doc and linting issue, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Mar 27, 2024
1 parent 08cb86b commit e2da108
Show file tree
Hide file tree
Showing 14 changed files with 812 additions and 647 deletions.
1,432 changes: 803 additions & 629 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cli/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ pub struct DecompressOpts {
pub output: PathBuf,
}

/// This parser wrapper is used by clap to parse a `&str` as [Source](subwasmlib::source::Source).
/// This parser wrapper is used by clap to parse a `&str` as [Source].
pub fn parse_source(s: &str) -> error::Result<Source> {
Source::try_from(s).map_err(|_e| error::SubwasmError::SourceParseError(s.to_string()))
}
4 changes: 2 additions & 2 deletions lib/src/chain_info.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{chain_urls::get_chain_urls, error, SubwasmLibError};
use crate::{chain_urls::get_chain_urls, error};
use error::*;
use rand::seq::SliceRandom;
use std::str::FromStr;
Expand Down Expand Up @@ -31,7 +31,7 @@ pub struct ChainInfo {
/// Name of the chain
pub name: String,

/// List of endpoints for the chain [name]
/// List of endpoints for the chain [ChainInfo::name]
pub endpoints: Vec<NodeEndpoint>,
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::github_ref::GithubRef;
use crate::is_wasm_from_url;
use crate::ChainInfo;

/// The [wasmloader] provides a basic Source struct that
/// The [wasm_loader::WasmLoader] provides a basic Source struct that
/// can handle only a file or RPC endpoint.
/// This Enum here is fancier and will allow more sources.
#[derive(Debug, Clone, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion lib/src/subwasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
error::*,
metadata_wrapper::{self, MetadataWrapper},
utils::print_big_output_safe,
RuntimeInfo, SubwasmLibError,
RuntimeInfo,
};

/// The main `subwasm` object
Expand Down
3 changes: 0 additions & 3 deletions libs/substrate-differ/src/differs/reduced/calls/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use super::{
signature::{Arg, Signature},
};
use comparable::Comparable;
use scale_info::{form::PortableForm, TypeDefVariant};
use serde::Serialize;
use std::{collections::BTreeMap, fmt::Display};

Expand Down Expand Up @@ -70,8 +69,6 @@ pub fn variant_to_calls(td: &TypeDefVariant<PortableForm>) -> BTreeMap<PalletId,

#[cfg(test)]
mod test_reduced_call {
use crate::differs::reduced::calls::signature::Arg;

use super::*;

#[test]
Expand Down
2 changes: 0 additions & 2 deletions libs/substrate-differ/src/differs/reduced/pallet_item.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use super::calls::{call::*, constant::*, error::*, event::*, storage::*};
use comparable::Comparable;
// use frame_metadata::PalletCallMetadata;
// use scale_info::form::PortableForm;
use std::fmt::Display;

#[derive(Debug, PartialEq, Hash, Comparable, PartialOrd, Ord, Eq)]
Expand Down
3 changes: 1 addition & 2 deletions libs/substrate-differ/src/differs/reduced/reduced_pallet.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use super::calls::{prelude::PalletId, *};
use super::calls::*;
use comparable::Comparable;
use frame_metadata::v14::PalletMetadata;
use scale_info::form::PortableForm;
use serde::Serialize;
use std::{collections::BTreeMap, fmt::Display};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl ReducedRuntime {
.find(|reduced_pallet| reduced_pallet.name.to_lowercase() == pallet_name.to_ascii_lowercase())
}

/// You can also use [get_pallet_by_name](fn@get_pallet_by_name) but prefer using [get_pallet_by_id](fn@get_pallet_by_id) where you can.
/// You can also use [get_pallet_by_name](ReducedRuntime::get_pallet_by_name) but prefer using [get_pallet_by_id](ReducedRuntime::get_pallet_by_id) where you can.
pub fn get_pallet_by_id(&self, pallet_id: PalletId) -> Option<&ReducedPallet> {
self.pallets.get(&pallet_id)
}
Expand Down
1 change: 0 additions & 1 deletion libs/substrate-runtime-proposal-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ readme = "README.md"
repository = "https://github.com/chevdor/subwasm"

[dependencies]
log = "0.4"
hex = "0.4"
blake2 = "0.10"
thiserror = "1.0"
Expand Down
1 change: 0 additions & 1 deletion libs/wasm-loader/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// use std::fmt;
use thiserror::Error;

pub type Result<T> = std::result::Result<T, WasmLoaderError>;
Expand Down
2 changes: 1 addition & 1 deletion libs/wasm-loader/src/node_endpoint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use url::Url;

use crate::error::{self, WasmLoaderError};
use crate::error::{self};
use error::*;
use std::str::FromStr;

Expand Down
2 changes: 1 addition & 1 deletion libs/wasm-loader/src/onchain_block.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
error::{self, WasmLoaderError},
error::{self},
NodeEndpoint,
};
use std::str::FromStr;
Expand Down
1 change: 0 additions & 1 deletion libs/wasm-testbed/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use sc_executor_common::error::WasmError;
// use std::fmt;
use substrate_runtime_proposal_hash::error::RuntimePropHashError;
use thiserror::Error;

Expand Down

0 comments on commit e2da108

Please sign in to comment.