Skip to content

Commit

Permalink
cleaning up warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mm-zk committed Jun 4, 2024
1 parent b86d85c commit a536dc5
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 60 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

44 changes: 22 additions & 22 deletions core/lib/basic_types/src/web3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,28 @@ pub enum SyncState {
NotSyncing,
}

// Sync info from subscription has a different key format
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
struct SubscriptionSyncInfo {
/// The block at which import began.
pub starting_block: U256,
/// The highest currently synced block.
pub current_block: U256,
/// The estimated highest block.
pub highest_block: U256,
}

impl From<SubscriptionSyncInfo> for SyncInfo {
fn from(s: SubscriptionSyncInfo) -> Self {
Self {
starting_block: s.starting_block,
current_block: s.current_block,
highest_block: s.highest_block,
}
}
}

// The `eth_syncing` method returns either `false` or an instance of the sync info object.
// This doesn't play particularly well with the features exposed by `serde_derive`,
// so we use the custom impls below to ensure proper behavior.
Expand All @@ -850,28 +872,6 @@ impl<'de> Deserialize<'de> for SyncState {
where
D: Deserializer<'de>,
{
// Sync info from subscription has a different key format
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
struct SubscriptionSyncInfo {
/// The block at which import began.
pub starting_block: U256,
/// The highest currently synced block.
pub current_block: U256,
/// The estimated highest block.
pub highest_block: U256,
}

impl From<SubscriptionSyncInfo> for SyncInfo {
fn from(s: SubscriptionSyncInfo) -> Self {
Self {
starting_block: s.starting_block,
current_block: s.current_block,
highest_block: s.highest_block,
}
}
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
struct SubscriptionSyncState {
pub syncing: bool,
Expand Down
1 change: 0 additions & 1 deletion core/lib/dal/src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use zksync_types::{ProtocolVersionId, H160, H256};

pub mod storage_eth_tx;
pub mod storage_event;
pub mod storage_fee_monitor;
pub mod storage_log;
pub mod storage_oracle_info;
pub mod storage_protocol_version;
Expand Down
16 changes: 0 additions & 16 deletions core/lib/dal/src/models/storage_fee_monitor.rs

This file was deleted.

3 changes: 3 additions & 0 deletions core/lib/multivm/src/versions/vm_1_4_1/old_vm/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub(crate) enum VmExecutionResult {
Ok(Vec<u8>),
Revert(Vec<u8>),
Panic,
#[allow(dead_code)]
MostLikelyDidNotFinish(Address, u16),
}

Expand All @@ -31,6 +32,7 @@ pub(crate) const fn aux_heap_page_from_base(base: MemoryPage) -> MemoryPage {
MemoryPage(base.0 + 3)
}

#[allow(dead_code)]
pub(crate) trait FixedLengthIterator<'a, I: 'a, const N: usize>: Iterator<Item = I>
where
Self: 'a,
Expand All @@ -42,6 +44,7 @@ where

pub(crate) trait IntoFixedLengthByteIterator<const N: usize> {
type IntoIter: FixedLengthIterator<'static, u8, N>;
#[allow(dead_code)]
fn into_le_iter(self) -> Self::IntoIter;
fn into_be_iter(self) -> Self::IntoIter;
}
Expand Down
3 changes: 3 additions & 0 deletions core/lib/multivm/src/versions/vm_1_4_2/old_vm/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub(crate) enum VmExecutionResult {
Ok(Vec<u8>),
Revert(Vec<u8>),
Panic,
#[allow(dead_code)]
MostLikelyDidNotFinish(Address, u16),
}

Expand All @@ -31,6 +32,7 @@ pub(crate) const fn aux_heap_page_from_base(base: MemoryPage) -> MemoryPage {
MemoryPage(base.0 + 3)
}

#[allow(dead_code)]
pub(crate) trait FixedLengthIterator<'a, I: 'a, const N: usize>: Iterator<Item = I>
where
Self: 'a,
Expand All @@ -42,6 +44,7 @@ where

pub(crate) trait IntoFixedLengthByteIterator<const N: usize> {
type IntoIter: FixedLengthIterator<'static, u8, N>;
#[allow(dead_code)]
fn into_le_iter(self) -> Self::IntoIter;
fn into_be_iter(self) -> Self::IntoIter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) enum VmExecutionResult {
Ok(Vec<u8>),
Revert(Vec<u8>),
Panic,
#[allow(dead_code)]
MostLikelyDidNotFinish(Address, u16),
}

Expand All @@ -34,6 +35,7 @@ pub(crate) const fn aux_heap_page_from_base(base: MemoryPage) -> MemoryPage {
MemoryPage(base.0 + 3)
}

#[allow(dead_code)]
pub(crate) trait FixedLengthIterator<'a, I: 'a, const N: usize>: Iterator<Item = I>
where
Self: 'a,
Expand All @@ -45,6 +47,7 @@ where

pub(crate) trait IntoFixedLengthByteIterator<const N: usize> {
type IntoIter: FixedLengthIterator<'static, u8, N>;
#[allow(dead_code)]
fn into_le_iter(self) -> Self::IntoIter;
fn into_be_iter(self) -> Self::IntoIter;
}
Expand Down
3 changes: 3 additions & 0 deletions core/lib/multivm/src/versions/vm_latest/old_vm/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub(crate) enum VmExecutionResult {
Ok(Vec<u8>),
Revert(Vec<u8>),
Panic,
#[allow(dead_code)]
MostLikelyDidNotFinish(Address, u16),
}

Expand All @@ -33,6 +34,7 @@ pub(crate) const fn aux_heap_page_from_base(base: MemoryPage) -> MemoryPage {
MemoryPage(base.0 + 3)
}

#[allow(dead_code)]
pub(crate) trait FixedLengthIterator<'a, I: 'a, const N: usize>: Iterator<Item = I>
where
Self: 'a,
Expand All @@ -44,6 +46,7 @@ where

pub(crate) trait IntoFixedLengthByteIterator<const N: usize> {
type IntoIter: FixedLengthIterator<'static, u8, N>;
#[allow(dead_code)]
fn into_le_iter(self) -> Self::IntoIter;
fn into_be_iter(self) -> Self::IntoIter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) enum VmExecutionResult {
Ok(Vec<u8>),
Revert(Vec<u8>),
Panic,
#[allow(dead_code)]
MostLikelyDidNotFinish(Address, u16),
}

Expand All @@ -34,6 +35,7 @@ pub(crate) const fn aux_heap_page_from_base(base: MemoryPage) -> MemoryPage {
MemoryPage(base.0 + 3)
}

#[allow(dead_code)]
pub(crate) trait FixedLengthIterator<'a, I: 'a, const N: usize>: Iterator<Item = I>
where
Self: 'a,
Expand All @@ -45,6 +47,7 @@ where

pub(crate) trait IntoFixedLengthByteIterator<const N: usize> {
type IntoIter: FixedLengthIterator<'static, u8, N>;
#[allow(dead_code)]
fn into_le_iter(self) -> Self::IntoIter;
fn into_be_iter(self) -> Self::IntoIter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub(crate) enum VmExecutionResult {
Ok(Vec<u8>),
Revert(Vec<u8>),
Panic,
#[allow(dead_code)]
MostLikelyDidNotFinish(Address, u16),
}

Expand All @@ -34,6 +35,7 @@ pub(crate) const fn aux_heap_page_from_base(base: MemoryPage) -> MemoryPage {
MemoryPage(base.0 + 3)
}

#[allow(dead_code)]
pub(crate) trait FixedLengthIterator<'a, I: 'a, const N: usize>: Iterator<Item = I>
where
Self: 'a,
Expand All @@ -45,6 +47,7 @@ where

pub(crate) trait IntoFixedLengthByteIterator<const N: usize> {
type IntoIter: FixedLengthIterator<'static, u8, N>;
#[allow(dead_code)]
fn into_le_iter(self) -> Self::IntoIter;
fn into_be_iter(self) -> Self::IntoIter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub trait VmTracer<S: WriteStorage, H: HistoryMode>:
}

pub trait ToTracerPointer<S, H> {
#[allow(dead_code)]
fn into_tracer_pointer(self) -> TracerPointer<S, H>;
}

Expand Down
1 change: 1 addition & 0 deletions core/node/eth_sender/src/publish_criterion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use super::{metrics::METRICS, utils::agg_l1_batch_base_cost};

#[async_trait]
pub trait L1BatchPublishCriterion: fmt::Debug + Send + Sync {
#[allow(dead_code)]
// Takes `&self` receiver for the trait to be object-safe
fn name(&self) -> &'static str;

Expand Down
5 changes: 2 additions & 3 deletions core/tests/loadnext/src/sdk/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub use zksync_types::{self, ethabi, network::Network, web3};
pub use zksync_types::{self, ethabi, web3};
pub use zksync_web3_decl::{
jsonrpsee::http_client::*,
namespaces::{EthNamespaceClient, NetNamespaceClient, Web3NamespaceClient, ZksNamespaceClient},
namespaces::{EthNamespaceClient, ZksNamespaceClient},
types,
};

Expand Down
23 changes: 7 additions & 16 deletions prover/Cargo.lock

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

0 comments on commit a536dc5

Please sign in to comment.