Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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 }}

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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 \
echo "Usage: make integration-spec SPEC=pattern"; \
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
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.85.0
1.92.0
8 changes: 2 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl ArgParser<Vec<u8>> 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];
Expand Down Expand Up @@ -515,6 +515,7 @@ impl ArgParser<(Address, u128)> for UdtTargetParser {
}
}

#[allow(dead_code)]
pub struct ScriptIdParser;

impl ArgParser<ScriptId> for ScriptIdParser {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('.');
Expand Down
1 change: 0 additions & 1 deletion src/utils/mock_tx_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
3 changes: 3 additions & 0 deletions src/utils/rpc/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ impl From<rpc_types::TransactionView> 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<L, R> {
Expand All @@ -374,6 +375,7 @@ pub enum Either<L, R> {
///
/// `ResponseFormat<BlockView>` 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<V> {
Expand Down Expand Up @@ -458,6 +460,7 @@ impl TryFrom<rpc_types::TransactionWithStatusResponse> 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.
Expand Down
Loading