@@ -33,27 +33,29 @@ export interface RunCallOpts {
33
33
* @ignore
34
34
*/
35
35
export default function runCall ( this : VM , opts : RunCallOpts ) : Promise < EVMResult > {
36
- const block = opts . block || new Block ( )
36
+ const block = opts . block ?? Block . fromBlockData ( { } , { common : this . _common } )
37
37
38
38
const txContext = new TxContext (
39
- opts . gasPrice || new BN ( 0 ) ,
40
- opts . origin || opts . caller || Address . zero ( )
39
+ opts . gasPrice ?? new BN ( 0 ) ,
40
+ opts . origin ?? opts . caller ?? Address . zero ( )
41
41
)
42
+
42
43
const message = new Message ( {
43
44
caller : opts . caller ,
44
- gasLimit : opts . gasLimit ? opts . gasLimit : new BN ( 0xffffff ) ,
45
- to : opts . to ? opts . to : undefined ,
45
+ gasLimit : opts . gasLimit ?? new BN ( 0xffffff ) ,
46
+ to : opts . to ?? undefined ,
46
47
value : opts . value ,
47
48
data : opts . data ,
48
49
code : opts . code ,
49
- depth : opts . depth || 0 ,
50
- isCompiled : opts . compiled || false ,
51
- isStatic : opts . static || false ,
52
- salt : opts . salt || null ,
53
- selfdestruct : opts . selfdestruct || { } ,
54
- delegatecall : opts . delegatecall || false ,
50
+ depth : opts . depth ?? 0 ,
51
+ isCompiled : opts . compiled ?? false ,
52
+ isStatic : opts . static ?? false ,
53
+ salt : opts . salt ?? null ,
54
+ selfdestruct : opts . selfdestruct ?? { } ,
55
+ delegatecall : opts . delegatecall ?? false ,
55
56
} )
56
57
57
58
const evm = new EVM ( this , txContext , block )
59
+
58
60
return evm . executeMessage ( message )
59
61
}
0 commit comments