Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
bring createPendingBlock func up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaiahReid committed Jun 14, 2022
1 parent acf1219 commit 5581338
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/chains/ethereum/ethereum/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ export default class Blockchain extends Emittery<BlockchainTypedEvents> {
// The block that is currently being mined is what we want to return as pending,
// so we'll reset the executables to be what it was when mining started,
// i.e. all inProgress executables are moved to the front of the pending executables.
const executables = this.transactions.transactionPool.cloneAndResetExecutables();
const executables =
this.transactions.transactionPool.cloneAndResetExecutables();
const instamine = this.#instamine;
const maxTransactions = instamine ? 1 : -1;
// we don't want any events from mining to be
Expand All @@ -598,13 +599,7 @@ export default class Blockchain extends Emittery<BlockchainTypedEvents> {
true
);
vm.stateManager.checkpoint();
const miner = new Miner(
minerOpts,
executables,
instamine,
vm,
this.#readyNextBlock
);
const miner = new Miner(minerOpts, executables, vm, this.#readyNextBlock);
let pendingBlock: Block;
// set up listener to actually assign the newly mined pending block
miner.on(
Expand All @@ -613,7 +608,7 @@ export default class Blockchain extends Emittery<BlockchainTypedEvents> {
block: Block;
serialized: Buffer;
storageKeys: StorageKeys;
transactions: RuntimeTransaction[];
transactions: TypedTransaction[];
}) => {
pendingBlock = blockData.block;
}
Expand Down

0 comments on commit 5581338

Please sign in to comment.