diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d784298f..1037d451 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.71.1 + toolchain: 1.92.0 - if: matrix.os == 'windows-latest' name: Windows Dependencies shell: pwsh @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.71.1 + toolchain: 1.92.0 - name: Integration_Test run: make integration @@ -57,7 +57,7 @@ jobs: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.71.1 + toolchain: 1.92.0 - name: Linters run: | cargo fmt --version || rustup component add rustfmt @@ -78,8 +78,9 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.71.1 - - uses: EmbarkStudios/cargo-deny-action@v1 + toolchain: 1.92.0 + - name: cargo-deny + uses: EmbarkStudios/cargo-deny-action@v2 with: command: check ${{ matrix.checks }} diff --git a/Makefile b/Makefile index 5bd9e248..cc8e15f0 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ ci: fmt clippy test security-audit check-crates check-licenses git diff --exit-code Cargo.lock integration: - bash devtools/ci/integration.sh v0.203.0 $(ARGS) + bash devtools/ci/integration.sh v0.204.0 $(ARGS) integration-spec: @if [ -z "$(SPEC)" ]; then \ @@ -25,7 +25,7 @@ integration-spec: echo "Example: make integration-spec SPEC=deploy_type_id"; \ exit 1; \ fi - bash devtools/ci/integration.sh v0.203.0 --spec=$(SPEC) + bash devtools/ci/integration.sh v0.204.0 --spec=$(SPEC) prod: ## Build binary with release profile. cargo build --locked --release diff --git a/rust-toolchain b/rust-toolchain index f288d111..7f229af9 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.85.0 +1.92.0 diff --git a/src/main.rs b/src/main.rs index 4ae6346f..8344282c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,12 +112,8 @@ async fn main() -> Result<(), io::Error> { if let Some(format) = matches.value_of("output-format") { output_format = OutputFormat::from_str(format).unwrap(); } - let mut key_store = get_key_store(ckb_cli_dir.clone()).map_err(|err| { - io::Error::new( - io::ErrorKind::Other, - format!("Open file based key store error: {}", err), - ) - })?; + let mut key_store = get_key_store(ckb_cli_dir.clone()) + .map_err(|err| io::Error::other(format!("Open file based key store error: {}", err)))?; let mut plugin_mgr = PluginManager::init(&ckb_cli_dir, ckb_url).unwrap(); let result = match matches.subcommand() { ("rpc", Some(sub_matches)) => match sub_matches.subcommand() { diff --git a/src/utils/arg_parser.rs b/src/utils/arg_parser.rs index 66c69339..5f76f24a 100644 --- a/src/utils/arg_parser.rs +++ b/src/utils/arg_parser.rs @@ -158,7 +158,7 @@ impl ArgParser> for HexParser { if input.starts_with("0x") || input.starts_with("0X") { input = &input[2..]; } - if input.len() % 2 != 0 { + if !input.len().is_multiple_of(2) { return Err(format!("Invalid hex string lenth: {}", input.len())); } let mut bytes = vec![0u8; input.len() / 2]; @@ -515,6 +515,7 @@ impl ArgParser<(Address, u128)> for UdtTargetParser { } } +#[allow(dead_code)] pub struct ScriptIdParser; impl ArgParser for ScriptIdParser { diff --git a/src/utils/config.rs b/src/utils/config.rs index 88562866..d124c1ed 100644 --- a/src/utils/config.rs +++ b/src/utils/config.rs @@ -48,7 +48,7 @@ impl GlobalConfig { self } - pub fn get(&self, key: Option<&str>) -> KV { + pub fn get(&self, key: Option<&str>) -> KV<'_> { match key { Some(key) => { let mut parts_iter = key.split('.'); diff --git a/src/utils/mock_tx_helper.rs b/src/utils/mock_tx_helper.rs index 4dcf2ca4..93e66fc6 100644 --- a/src/utils/mock_tx_helper.rs +++ b/src/utils/mock_tx_helper.rs @@ -266,7 +266,6 @@ impl<'a> MockTransactionHelper<'a> { witnesses[init_witness_idx] = init_witness.as_bytes().pack(); rpc_tx.witnesses = witnesses .iter() - .cloned() .map(|witness| rpc_types::JsonBytes::from_bytes(witness.raw_data())) .collect(); let sig = diff --git a/src/utils/rpc/types.rs b/src/utils/rpc/types.rs index 6f2d4071..6fb59c37 100644 --- a/src/utils/rpc/types.rs +++ b/src/utils/rpc/types.rs @@ -359,6 +359,7 @@ impl From for TransactionView { /// The enum `Either` with variants `Left` and `Right` is a general purpose /// sum type with two cases. +#[allow(dead_code)] #[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Debug)] #[serde(untagged)] pub enum Either { @@ -374,6 +375,7 @@ pub enum Either { /// /// `ResponseFormat` returns the block in its Json format or molecule serialized /// Hex format. +#[allow(dead_code)] #[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Debug)] #[serde(transparent)] pub struct ResponseFormat { @@ -458,6 +460,7 @@ impl TryFrom for PackedTransactionWith } /// The JSON view of a transaction as well as its status. +#[allow(dead_code)] #[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Debug)] pub struct TransactionWithStatusResponse { /// The transaction.