Skip to content

Commit 19ecdde

Browse files
authored
chore: rm work type (#10474)
1 parent 90a8746 commit 19ecdde

File tree

2 files changed

+4
-28
lines changed

2 files changed

+4
-28
lines changed

crates/anvil/core/src/types.rs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
1-
use alloy_primitives::{Bytes, B256, U256};
1+
use alloy_primitives::Bytes;
22
use alloy_rpc_types::TransactionRequest;
3-
use serde::{Deserialize, Serialize, Serializer};
4-
5-
/// Represents the result of `eth_getWork`.
6-
///
7-
/// This may or may not include the block number.
8-
#[derive(Debug, Default, PartialEq, Eq)]
9-
pub struct Work {
10-
pub pow_hash: B256,
11-
pub seed_hash: B256,
12-
pub target: B256,
13-
pub number: Option<u64>,
14-
}
15-
16-
impl Serialize for Work {
17-
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
18-
where
19-
S: Serializer,
20-
{
21-
if let Some(num) = self.number {
22-
(&self.pow_hash, &self.seed_hash, &self.target, U256::from(num)).serialize(s)
23-
} else {
24-
(&self.pow_hash, &self.seed_hash, &self.target).serialize(s)
25-
}
26-
}
27-
}
3+
use serde::Deserialize;
284

295
/// Represents the options used in `anvil_reorg`
306
#[derive(Debug, Clone, Deserialize)]

crates/anvil/src/eth/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use alloy_rpc_types::{
6262
},
6363
txpool::{TxpoolContent, TxpoolInspect, TxpoolInspectSummary, TxpoolStatus},
6464
AccessList, AccessListResult, BlockId, BlockNumberOrTag as BlockNumber, BlockTransactions,
65-
EIP1186AccountProofResponse, FeeHistory, Filter, FilteredParams, Index, Log,
65+
EIP1186AccountProofResponse, FeeHistory, Filter, FilteredParams, Index, Log, Work,
6666
};
6767
use alloy_serde::WithOtherFields;
6868
use alloy_transport::TransportErrorKind;
@@ -76,7 +76,7 @@ use anvil_core::{
7676
wallet::{WalletCapabilities, WalletError},
7777
EthRequest,
7878
},
79-
types::{ReorgOptions, TransactionData, Work},
79+
types::{ReorgOptions, TransactionData},
8080
};
8181
use anvil_rpc::{error::RpcError, response::ResponseResult};
8282
use foundry_common::provider::ProviderBuilder;

0 commit comments

Comments
 (0)