@@ -134,7 +134,7 @@ type EVM struct {
134
134
chainRules params.Rules
135
135
// virtual machine configuration options used to initialise the
136
136
// evm.
137
- vmConfig Config
137
+ VmConfig Config
138
138
// global (to this context) ethereum virtual machine
139
139
// used throughout the execution of the tx.
140
140
interpreters []Interpreter
@@ -155,7 +155,7 @@ func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, chainConfig
155
155
evm .Context = blockCtx
156
156
evm .TxContext = txCtx
157
157
evm .StateDB = statedb
158
- evm .vmConfig = vmConfig
158
+ evm .VmConfig = vmConfig
159
159
evm .chainConfig = chainConfig
160
160
evm .chainRules = chainConfig .Rules (blockCtx .BlockNumber )
161
161
evm .interpreters = make ([]Interpreter , 0 , 1 )
@@ -215,7 +215,7 @@ func (evm *EVM) Interpreter() Interpreter {
215
215
// the necessary steps to create accounts and reverses the state in case of an
216
216
// execution error or failed value transfer.
217
217
func (evm * EVM ) Call (caller ContractRef , addr common.Address , input []byte , gas uint64 , value * big.Int ) (ret []byte , leftOverGas uint64 , err error ) {
218
- if evm .vmConfig .NoRecursion && evm .depth > 0 {
218
+ if evm .VmConfig .NoRecursion && evm .depth > 0 {
219
219
return nil , gas , nil
220
220
}
221
221
// Fail if we're trying to execute above the call depth limit
@@ -232,13 +232,13 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
232
232
if ! evm .StateDB .Exist (addr ) {
233
233
if ! isPrecompile && evm .chainRules .IsEIP158 && value .Sign () == 0 {
234
234
// Calling a non existing account, don't do anything, but ping the tracer
235
- if evm .vmConfig .Debug {
235
+ if evm .VmConfig .Debug {
236
236
if evm .depth == 0 {
237
- evm .vmConfig .Tracer .CaptureStart (evm , caller .Address (), addr , false , input , gas , value )
238
- evm .vmConfig .Tracer .CaptureEnd (ret , 0 , 0 , nil )
237
+ evm .VmConfig .Tracer .CaptureStart (evm , caller .Address (), addr , false , input , gas , value )
238
+ evm .VmConfig .Tracer .CaptureEnd (ret , 0 , 0 , nil )
239
239
} else {
240
- evm .vmConfig .Tracer .CaptureEnter (CALL , caller .Address (), addr , input , gas , value )
241
- evm .vmConfig .Tracer .CaptureExit (ret , 0 , nil )
240
+ evm .VmConfig .Tracer .CaptureEnter (CALL , caller .Address (), addr , input , gas , value )
241
+ evm .VmConfig .Tracer .CaptureExit (ret , 0 , nil )
242
242
}
243
243
}
244
244
return nil , gas , nil
@@ -248,17 +248,17 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
248
248
evm .Context .Transfer (evm .StateDB , caller .Address (), addr , value )
249
249
250
250
// Capture the tracer start/end events in debug mode
251
- if evm .vmConfig .Debug {
251
+ if evm .VmConfig .Debug {
252
252
if evm .depth == 0 {
253
- evm .vmConfig .Tracer .CaptureStart (evm , caller .Address (), addr , false , input , gas , value )
253
+ evm .VmConfig .Tracer .CaptureStart (evm , caller .Address (), addr , false , input , gas , value )
254
254
defer func (startGas uint64 , startTime time.Time ) { // Lazy evaluation of the parameters
255
- evm .vmConfig .Tracer .CaptureEnd (ret , startGas - gas , time .Since (startTime ), err )
255
+ evm .VmConfig .Tracer .CaptureEnd (ret , startGas - gas , time .Since (startTime ), err )
256
256
}(gas , time .Now ())
257
257
} else {
258
258
// Handle tracer events for entering and exiting a call frame
259
- evm .vmConfig .Tracer .CaptureEnter (CALL , caller .Address (), addr , input , gas , value )
259
+ evm .VmConfig .Tracer .CaptureEnter (CALL , caller .Address (), addr , input , gas , value )
260
260
defer func (startGas uint64 ) {
261
- evm .vmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
261
+ evm .VmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
262
262
}(gas )
263
263
}
264
264
}
@@ -304,7 +304,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
304
304
// CallCode differs from Call in the sense that it executes the given address'
305
305
// code with the caller as context.
306
306
func (evm * EVM ) CallCode (caller ContractRef , addr common.Address , input []byte , gas uint64 , value * big.Int ) (ret []byte , leftOverGas uint64 , err error ) {
307
- if evm .vmConfig .NoRecursion && evm .depth > 0 {
307
+ if evm .VmConfig .NoRecursion && evm .depth > 0 {
308
308
return nil , gas , nil
309
309
}
310
310
// Fail if we're trying to execute above the call depth limit
@@ -321,10 +321,10 @@ func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte,
321
321
var snapshot = evm .StateDB .Snapshot ()
322
322
323
323
// Invoke tracer hooks that signal entering/exiting a call frame
324
- if evm .vmConfig .Debug {
325
- evm .vmConfig .Tracer .CaptureEnter (CALLCODE , caller .Address (), addr , input , gas , value )
324
+ if evm .VmConfig .Debug {
325
+ evm .VmConfig .Tracer .CaptureEnter (CALLCODE , caller .Address (), addr , input , gas , value )
326
326
defer func (startGas uint64 ) {
327
- evm .vmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
327
+ evm .VmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
328
328
}(gas )
329
329
}
330
330
@@ -355,7 +355,7 @@ func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte,
355
355
// DelegateCall differs from CallCode in the sense that it executes the given address'
356
356
// code with the caller as context and the caller is set to the caller of the caller.
357
357
func (evm * EVM ) DelegateCall (caller ContractRef , addr common.Address , input []byte , gas uint64 ) (ret []byte , leftOverGas uint64 , err error ) {
358
- if evm .vmConfig .NoRecursion && evm .depth > 0 {
358
+ if evm .VmConfig .NoRecursion && evm .depth > 0 {
359
359
return nil , gas , nil
360
360
}
361
361
// Fail if we're trying to execute above the call depth limit
@@ -365,10 +365,10 @@ func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []by
365
365
var snapshot = evm .StateDB .Snapshot ()
366
366
367
367
// Invoke tracer hooks that signal entering/exiting a call frame
368
- if evm .vmConfig .Debug {
369
- evm .vmConfig .Tracer .CaptureEnter (DELEGATECALL , caller .Address (), addr , input , gas , nil )
368
+ if evm .VmConfig .Debug {
369
+ evm .VmConfig .Tracer .CaptureEnter (DELEGATECALL , caller .Address (), addr , input , gas , nil )
370
370
defer func (startGas uint64 ) {
371
- evm .vmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
371
+ evm .VmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
372
372
}(gas )
373
373
}
374
374
@@ -397,7 +397,7 @@ func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []by
397
397
// Opcodes that attempt to perform such modifications will result in exceptions
398
398
// instead of performing the modifications.
399
399
func (evm * EVM ) StaticCall (caller ContractRef , addr common.Address , input []byte , gas uint64 ) (ret []byte , leftOverGas uint64 , err error ) {
400
- if evm .vmConfig .NoRecursion && evm .depth > 0 {
400
+ if evm .VmConfig .NoRecursion && evm .depth > 0 {
401
401
return nil , gas , nil
402
402
}
403
403
// Fail if we're trying to execute above the call depth limit
@@ -418,10 +418,10 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte
418
418
evm .StateDB .AddBalance (addr , big0 )
419
419
420
420
// Invoke tracer hooks that signal entering/exiting a call frame
421
- if evm .vmConfig .Debug {
422
- evm .vmConfig .Tracer .CaptureEnter (STATICCALL , caller .Address (), addr , input , gas , nil )
421
+ if evm .VmConfig .Debug {
422
+ evm .VmConfig .Tracer .CaptureEnter (STATICCALL , caller .Address (), addr , input , gas , nil )
423
423
defer func (startGas uint64 ) {
424
- evm .vmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
424
+ evm .VmConfig .Tracer .CaptureExit (ret , startGas - gas , err )
425
425
}(gas )
426
426
}
427
427
@@ -498,15 +498,15 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
498
498
contract := NewContract (caller , AccountRef (address ), value , gas )
499
499
contract .SetCodeOptionalHash (& address , codeAndHash )
500
500
501
- if evm .vmConfig .NoRecursion && evm .depth > 0 {
501
+ if evm .VmConfig .NoRecursion && evm .depth > 0 {
502
502
return nil , address , gas , nil
503
503
}
504
504
505
- if evm .vmConfig .Debug {
505
+ if evm .VmConfig .Debug {
506
506
if evm .depth == 0 {
507
- evm .vmConfig .Tracer .CaptureStart (evm , caller .Address (), address , true , codeAndHash .code , gas , value )
507
+ evm .VmConfig .Tracer .CaptureStart (evm , caller .Address (), address , true , codeAndHash .code , gas , value )
508
508
} else {
509
- evm .vmConfig .Tracer .CaptureEnter (typ , caller .Address (), address , codeAndHash .code , gas , value )
509
+ evm .VmConfig .Tracer .CaptureEnter (typ , caller .Address (), address , codeAndHash .code , gas , value )
510
510
}
511
511
}
512
512
@@ -546,11 +546,11 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
546
546
}
547
547
}
548
548
549
- if evm .vmConfig .Debug {
549
+ if evm .VmConfig .Debug {
550
550
if evm .depth == 0 {
551
- evm .vmConfig .Tracer .CaptureEnd (ret , gas - contract .Gas , time .Since (start ), err )
551
+ evm .VmConfig .Tracer .CaptureEnd (ret , gas - contract .Gas , time .Since (start ), err )
552
552
} else {
553
- evm .vmConfig .Tracer .CaptureExit (ret , gas - contract .Gas , err )
553
+ evm .VmConfig .Tracer .CaptureExit (ret , gas - contract .Gas , err )
554
554
}
555
555
}
556
556
return ret , address , contract .Gas , err
0 commit comments