Skip to content

Commit

Permalink
fix: Failing doctest example for new mempool
Browse files Browse the repository at this point in the history
The mempool must now be initialized with a tip digest in order to keep
track of blocks for which the mempools transactions are valid. This is
introduced to allow the mempool to handle reorganizations without
containing invalid transactions.
  • Loading branch information
Sword-Smith committed May 21, 2024
1 parent bd7a252 commit 5c296cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/models/state/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ impl Mempool {
/// use neptune_core::models::state::mempool::Mempool;
/// use bytesize::ByteSize;
///
/// let mempool = Mempool::new(ByteSize::gb(1));
/// let network = Network::Main;
/// let genesis_block = Block::genesis_block(network);

Check failure on line 419 in src/models/state/mempool.rs

View workflow job for this annotation

GitHub Actions / format, lint, test (ubuntu-latest)

failed to resolve: use of undeclared type `Network`

Check failure on line 419 in src/models/state/mempool.rs

View workflow job for this annotation

GitHub Actions / format, lint, test (windows-latest)

failed to resolve: use of undeclared type `Network`

Check failure on line 419 in src/models/state/mempool.rs

View workflow job for this annotation

GitHub Actions / format, lint, test (macos-latest)

failed to resolve: use of undeclared type `Network`
/// let mempool = Mempool::new(ByteSize::gb(1), genesis_block);

Check failure on line 420 in src/models/state/mempool.rs

View workflow job for this annotation

GitHub Actions / format, lint, test (ubuntu-latest)

failed to resolve: use of undeclared type `Block`

Check failure on line 420 in src/models/state/mempool.rs

View workflow job for this annotation

GitHub Actions / format, lint, test (windows-latest)

failed to resolve: use of undeclared type `Block`

Check failure on line 420 in src/models/state/mempool.rs

View workflow job for this annotation

GitHub Actions / format, lint, test (macos-latest)

failed to resolve: use of undeclared type `Block`
/// // insert transactions here.
/// let mut most_valuable_transactions = vec![];
/// for (transaction_digest, fee_density) in mempool.get_sorted_iter() {
Expand Down

0 comments on commit 5c296cf

Please sign in to comment.