Skip to content

Commit

Permalink
chore: fix small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Jan 14, 2025
1 parent 0e613bd commit 6a6ba01
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 113 deletions.
108 changes: 8 additions & 100 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl BuildResult {
.to_string()
.bold()
);
return out
return out;
};

let mut out = format!(
Expand Down Expand Up @@ -610,7 +610,7 @@ fn check_dylint_requirements(_working_dir: Option<&Path>) -> Result<()> {
child
} else {
tracing::debug!("Error spawning `{:?}`", cmd);
return false
return false;
};

child.wait().map(|ret| ret.success()).unwrap_or_else(|err| {
Expand Down Expand Up @@ -717,7 +717,7 @@ pub fn execute(args: ExecuteArgs) -> Result<BuildResult> {

// if image exists, then --verifiable was called and we need to build inside docker.
if build_mode == &BuildMode::Verifiable {
return docker_build(args)
return docker_build(args);
}

// The CLI flag `optimization-passes` overwrites optimization passes which are
Expand Down Expand Up @@ -824,7 +824,6 @@ fn local_build(
network,
unstable_flags,
keep_debug_symbols,
extra_lints,
skip_wasm_validation,
target,
max_memory_pages,
Expand Down Expand Up @@ -900,7 +899,7 @@ fn local_build(
crate_metadata.original_code.display(),
pre_fingerprint
);
return Ok((None, build_info, dest_code_path))
return Ok((None, build_info, dest_code_path));
}

verbose_eprintln!(
Expand Down
2 changes: 1 addition & 1 deletion crates/extrinsics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ink_metadata = { workspace = true }
ink_env = { workspace = true }

[dev-dependencies]
ink = "5.0.0"
ink = { workspace = true, features = ["unstable"] }
assert_cmd = "2.0.14"
regex = "1.10.4"
predicates = "3.1.0"
Expand Down
14 changes: 7 additions & 7 deletions crates/transcode/src/account_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,22 @@ impl AccountId32 {
use base58::FromBase58;
let data = s.from_base58().map_err(|_| FromSs58Error::BadBase58)?;
if data.len() < 2 {
return Err(FromSs58Error::BadLength)
return Err(FromSs58Error::BadLength);
}
let prefix_len = match data[0] {
0..=63 => 1,
64..=127 => 2,
_ => return Err(FromSs58Error::InvalidPrefix),
};
if data.len() != prefix_len + body_len + CHECKSUM_LEN {
return Err(FromSs58Error::BadLength)
return Err(FromSs58Error::BadLength);
}
let hash = ss58hash(&data[0..body_len + prefix_len]);
let checksum = &hash[0..CHECKSUM_LEN];
if data[body_len + prefix_len..body_len + prefix_len + CHECKSUM_LEN] != *checksum
{
// Invalid checksum.
return Err(FromSs58Error::InvalidChecksum)
return Err(FromSs58Error::InvalidChecksum);
}

let result = data[prefix_len..body_len + prefix_len]
Expand Down Expand Up @@ -212,14 +212,14 @@ mod test {
use super::*;

use sp_core::crypto::Ss58Codec;
use sp_keyring::AccountKeyring;
use sp_keyring::Sr25519Keyring;

#[test]
fn ss58_is_compatible_with_substrate_impl() {
let keyrings = vec![
AccountKeyring::Alice,
AccountKeyring::Bob,
AccountKeyring::Charlie,
Sr25519Keyring::Alice,
Sr25519Keyring::Bob,
Sr25519Keyring::Charlie,
];

for keyring in keyrings {
Expand Down

0 comments on commit 6a6ba01

Please sign in to comment.