Skip to content

Commit

Permalink
chore: pre-commit run --all
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifechukwudaniel committed Jan 18, 2025
1 parent 4380ef4 commit 996f398
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion target_chains/ethereum/sdk/stylus/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(clippy::pub_underscore_fields, clippy::module_name_repetitions)]
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![deny(rustdoc::broken_intra_doc_links)]

#![allow(clippy::let_unit_value)]
extern crate alloc;

#[global_allocator]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::too_many_arguments)]
use crate::pyth::mock::DecodeDataType;
use crate::pyth::types::{
getEmaPriceNoOlderThanCall, getEmaPriceUnsafeCall, getPriceNoOlderThanCall, getPriceUnsafeCall,
Expand Down Expand Up @@ -272,5 +273,5 @@ pub fn create_price_feed_update_data(
};

let price_feed_data_encoding = (price_feed_data, prev_publish_time);
return DecodeDataType::abi_encode(&price_feed_data_encoding);
DecodeDataType::abi_encode(&price_feed_data_encoding)
}
14 changes: 8 additions & 6 deletions target_chains/ethereum/sdk/stylus/contracts/src/pyth/mock.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::clone_on_copy)]
#![allow(clippy::too_many_arguments)]
use crate::pyth::errors::{Error, PriceFeedNotFound};
use crate::pyth::events::PriceFeedUpdate;
use crate::pyth::functions::create_price_feed_update_data;
Expand All @@ -11,7 +13,7 @@ use alloy_primitives::{Bytes, B256, U256};
use alloy_sol_types::{sol_data::Uint as SolUInt, SolType, SolValue};
use stylus_sdk::{abi::Bytes as AbiBytes, evm, msg, prelude::*};

////Decode data type PriceFeed and uint64
/// Decode data type PriceFeed and uint64
pub type DecodeDataType = (PriceFeed, SolUInt<64>);

sol_storage! {
Expand Down Expand Up @@ -169,7 +171,7 @@ impl MockPythContract {
};

let price_feed_data_encoding = (price_feed_data, prev_publish_time);
return DecodeDataType::abi_encode(&price_feed_data_encoding);
DecodeDataType::abi_encode(&price_feed_data_encoding)
}
}

Expand Down Expand Up @@ -248,12 +250,12 @@ pub fn create_price_feed_update_data_list() -> (Vec<Bytes>, Vec<B256>) {
.update(x.as_bytes())
.finalize()
.to_vec();
return B256::from_slice(&x);
B256::from_slice(&x)
});
let mut price_feed_data_list = Vec::new();
for i in 0..3 {
for item in &id {
let price_feed_data = create_price_feed_update_data(
id[i],
*item,
100,
100,
100,
Expand All @@ -265,7 +267,7 @@ pub fn create_price_feed_update_data_list() -> (Vec<Bytes>, Vec<B256>) {
let price_feed_data = Bytes::from(AbiBytes::from(price_feed_data).0);
price_feed_data_list.push(price_feed_data);
}
return (price_feed_data_list, id.to_vec());
(price_feed_data_list, id.to_vec())
}

#[cfg(all(test, feature = "std"))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![cfg_attr(not(test), no_std, no_main)]
#![allow(clippy::let_unit_value)]
extern crate alloc;

use alloc::vec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use pyth_stylus::pyth::{
use stylus_sdk::{abi::Bytes, alloy_primitives::U256, msg, prelude::*, stylus_proc::SolidityError};

pub use sol::*;
#[cfg_attr(coverage_nightly, coverage(off))]

mod sol {
use alloy_sol_types::sol;

Expand Down

0 comments on commit 996f398

Please sign in to comment.