File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { Common, Mainnet } from '@ethereumjs/common'
2
2
import { SimpleStateManager } from '@ethereumjs/statemanager'
3
3
4
4
import { NobleBN254 } from './precompiles/index.js'
5
- import { DefaultBlockchain } from './types.js'
5
+ import { EVMMockBlockchain } from './types.js'
6
6
7
7
import { EVM } from './index.js'
8
8
@@ -25,7 +25,7 @@ export async function createEVM(createOpts?: EVMOpts) {
25
25
}
26
26
27
27
if ( opts . blockchain === undefined ) {
28
- opts . blockchain = new DefaultBlockchain ( )
28
+ opts . blockchain = new EVMMockBlockchain ( )
29
29
}
30
30
31
31
if ( opts . stateManager === undefined ) {
Original file line number Diff line number Diff line change @@ -343,9 +343,13 @@ export interface EVMOpts {
343
343
stateManager ?: StateManagerInterface
344
344
345
345
/**
346
+ * The EVM comes with a basic mock blockchain interface and implementation for
347
+ * non-block containing use cases.
346
348
*
349
+ * For block-containing setups use the full blockchain implementation from the
350
+ * `@ethereumjs/blockchain package.
347
351
*/
348
- blockchain ?: Blockchain
352
+ blockchain ?: EVMMockBlockchainInterface
349
353
350
354
/**
351
355
*
@@ -472,16 +476,16 @@ export interface TransientStorageInterface {
472
476
clear ( ) : void
473
477
}
474
478
475
- type MockBlock = {
479
+ export type EVMMockBlock = {
476
480
hash ( ) : Uint8Array
477
481
}
478
482
479
- export interface Blockchain {
480
- getBlock ( blockId : number ) : Promise < MockBlock >
481
- shallowCopy ( ) : Blockchain
483
+ export interface EVMMockBlockchainInterface {
484
+ getBlock ( blockId : number ) : Promise < EVMMockBlock >
485
+ shallowCopy ( ) : EVMMockBlockchainInterface
482
486
}
483
487
484
- export class DefaultBlockchain implements Blockchain {
488
+ export class EVMMockBlockchain implements EVMMockBlockchainInterface {
485
489
async getBlock ( ) {
486
490
return {
487
491
hash ( ) {
You can’t perform that action at this time.
0 commit comments