Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
ac1c8feb
Commit
ac1c8feb
authored
Sep 07, 2021
by
hezhengjun
Committed by
vipwzw
Sep 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct evmDebugEnable set
parent
5644d6a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
evm.go
plugin/dapp/evm/executor/evm.go
+1
-4
exec.go
plugin/dapp/evm/executor/exec.go
+5
-0
No files found.
plugin/dapp/evm/executor/evm.go
View file @
ac1c8feb
...
@@ -21,6 +21,7 @@ import (
...
@@ -21,6 +21,7 @@ import (
)
)
var
(
var
(
evmDebugInited
=
false
// EvmAddress 本合约地址
// EvmAddress 本合约地址
EvmAddress
=
""
EvmAddress
=
""
)
)
...
@@ -50,10 +51,6 @@ func GetName() string {
...
@@ -50,10 +51,6 @@ func GetName() string {
func
newEVMDriver
()
drivers
.
Driver
{
func
newEVMDriver
()
drivers
.
Driver
{
evm
:=
NewEVMExecutor
()
evm
:=
NewEVMExecutor
()
cfg
:=
evm
.
GetAPI
()
.
GetConfig
()
conf
:=
types
.
ConfSub
(
cfg
,
evmtypes
.
ExecutorName
)
evmDebugEnable
:=
conf
.
IsEnable
(
"evmDebugEnable"
)
evm
.
vmCfg
.
Debug
=
evmDebugEnable
return
evm
return
evm
}
}
...
...
plugin/dapp/evm/executor/exec.go
View file @
ac1c8feb
...
@@ -39,6 +39,11 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int,
...
@@ -39,6 +39,11 @@ func (evm *EVMExecutor) innerExec(msg *common.Message, txHash []byte, index int,
// 获取当前区块的上下文信息构造EVM上下文
// 获取当前区块的上下文信息构造EVM上下文
context
:=
evm
.
NewEVMContext
(
msg
,
txHash
)
context
:=
evm
.
NewEVMContext
(
msg
,
txHash
)
cfg
:=
evm
.
GetAPI
()
.
GetConfig
()
cfg
:=
evm
.
GetAPI
()
.
GetConfig
()
if
!
evmDebugInited
{
conf
:=
types
.
ConfSub
(
cfg
,
evmtypes
.
ExecutorName
)
evm
.
vmCfg
.
Debug
=
conf
.
IsEnable
(
"evmDebugEnable"
)
evmDebugInited
=
true
}
// 创建EVM运行时对象
// 创建EVM运行时对象
env
:=
runtime
.
NewEVM
(
context
,
evm
.
mStateDB
,
*
evm
.
vmCfg
,
cfg
)
env
:=
runtime
.
NewEVM
(
context
,
evm
.
mStateDB
,
*
evm
.
vmCfg
,
cfg
)
isCreate
:=
strings
.
Compare
(
msg
.
To
()
.
String
(),
EvmAddress
)
==
0
&&
len
(
msg
.
Data
())
>
0
isCreate
:=
strings
.
Compare
(
msg
.
To
()
.
String
(),
EvmAddress
)
==
0
&&
len
(
msg
.
Data
())
>
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment