Skip to content

Commit

Permalink
chore: make clippy happy again (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Aug 26, 2024
1 parent 2ddc694 commit 95fb1b6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: "Set allowed lints"
run: |
if [ "${{ matrix.toolchain }}" == "nightly" ]; then
echo "ALLOWED=-A non_local_definitions" >> $GITHUB_ENV
echo "ALLOWED=-A non_local_definitions -A clippy::too_long_first_doc_paragraph" >> $GITHUB_ENV
else
echo "ALLOWED=" >> $GITHUB_ENV
fi
Expand Down
8 changes: 4 additions & 4 deletions starknet-accounts/tests/single_owner_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ async fn can_execute_eth_transfer_invoke_v3_inner<P: Provider + Send + Sync>(
selector: get_selector_from_name("transfer").unwrap(),
calldata: vec![Felt::from_hex("0x1234").unwrap(), Felt::ONE, Felt::ZERO],
}])
.gas(200000)
.gas_price(500000000000000)
.gas(100000)
.gas_price(800000000000000)
.send()
.await
.unwrap();
Expand Down Expand Up @@ -544,8 +544,8 @@ async fn can_declare_cairo1_contract_v3_inner<P: Provider + Send + Sync>(
Arc::new(flattened_class),
Felt::from_hex(&hashes.compiled_class_hash).unwrap(),
)
.gas(200000)
.gas_price(500000000000000)
.gas(100000)
.gas_price(800000000000000)
.send()
.await
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions starknet-contract/tests/contract_deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ async fn can_deploy_contract_to_alpha_sepolia_with_invoke_v3() {

let result = factory
.deploy_v3(vec![Felt::ONE], Felt::from_bytes_be(&salt_buffer), true)
.gas(200000)
.gas_price(500000000000000)
.gas(100000)
.gas_price(800000000000000)
.send()
.await;

Expand Down
16 changes: 8 additions & 8 deletions starknet-core/src/types/eth_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl From<[u8; 20]> for EthAddress {

#[cfg(test)]
mod tests {
use super::{EthAddress, Felt, FromBytesSliceError, FromFieldElementError};
use super::{EthAddress, Felt};

use alloc::vec::*;

Expand Down Expand Up @@ -291,11 +291,12 @@ mod tests {
#[test]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
fn test_eth_address_from_felt_error() {
match EthAddress::from_felt(
if EthAddress::from_felt(
&Felt::from_hex("0x10000000000000000000000000000000000000000").unwrap(),
) {
Ok(_) => panic!("Expected error, but got Ok"),
Err(FromFieldElementError) => {}
)
.is_ok()
{
panic!("Expected error, but got Ok");
}
}

Expand All @@ -304,9 +305,8 @@ mod tests {
fn test_eth_address_from_slice_invalid_slice() {
let buffer: Vec<u8> = vec![0, 1, 2, 3, 4, 5, 6, 7];

match EthAddress::try_from(&buffer[0..4]) {
Ok(_) => panic!("Expected error, but got Ok"),
Err(FromBytesSliceError) => {}
if EthAddress::try_from(&buffer[0..4]).is_ok() {
panic!("Expected error, but got Ok");
}
}
}
1 change: 1 addition & 0 deletions starknet-core/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ pub enum TransactionTrace {
}

/// The execution result of a function invocation.
#[allow(clippy::large_enum_variant)]
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
#[serde(untagged)]
pub enum ExecuteInvocation {
Expand Down

0 comments on commit 95fb1b6

Please sign in to comment.