diff --git a/CHANGELOG.md b/CHANGELOG.md index 84da1688..8ad96f05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Unreleased +- Use correct, new transaction type for `typool_content` RPC endpoint [#1501](https://github.com/gakonst/ethers-rs/pull/1501) - Fix the default config for generated `BuildInfo` [#1458](https://github.com/gakonst/ethers-rs/pull/1458) - Allow configuration of the output directory of the generated `BuildInfo` [#1433](https://github.com/gakonst/ethers-rs/pull/1433) - capture unknown fields in `Block` and `Transaction` type via new `OtherFields` type [#1423](https://github.com/gakonst/ethers-rs/pull/1423) diff --git a/ethers-core/src/types/txpool.rs b/ethers-core/src/types/txpool.rs index 0b023cf4..a9462089 100644 --- a/ethers-core/src/types/txpool.rs +++ b/ethers-core/src/types/txpool.rs @@ -1,5 +1,4 @@ -use crate::types::{Address, TransactionRequest as TxpoolTransaction, U256, U64}; - +use crate::types::{Address, Bytes, H256, U256, U64}; use serde::{ de::{self, Deserializer, Visitor}, Deserialize, Serialize, @@ -108,7 +107,7 @@ impl Serialize for TxpoolInspectSummary { /// as the ones that are being scheduled for future execution only. /// /// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details -#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct TxpoolContent { /// pending tx pub pending: BTreeMap
>, @@ -116,6 +115,23 @@ pub struct TxpoolContent { pub queued: BTreeMap>, } +/// Represents the Transaction object as returned by `txpool_content` +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TxpoolTransaction { + pub block_hash: Option