Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
edd7879f
Commit
edd7879f
authored
Jul 23, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove duplicated checkpointAndCommit
parent
7d547150
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
29 deletions
+16
-29
execution-context.js
remix-lib/src/execution/execution-context.js
+13
-0
txRunner.js
remix-lib/src/execution/txRunner.js
+2
-15
genesis.js
remix-simulator/src/genesis.js
+1
-14
No files found.
remix-lib/src/execution/execution-context.js
View file @
edd7879f
...
@@ -220,6 +220,19 @@ function ExecutionContext () {
...
@@ -220,6 +220,19 @@ function ExecutionContext () {
}
}
}
}
this
.
checkpointAndCommit
=
function
(
cb
,
checkpointCount
)
{
if
(
this
.
vm
().
stateManager
.
_checkpointCount
>
(
checkpointCount
||
0
))
{
return
this
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
}
this
.
vm
().
stateManager
.
checkpoint
(()
=>
{
this
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
})
}
this
.
currentblockGasLimit
=
function
()
{
this
.
currentblockGasLimit
=
function
()
{
return
this
.
blockGasLimit
return
this
.
blockGasLimit
}
}
...
...
remix-lib/src/execution/txRunner.js
View file @
edd7879f
...
@@ -135,7 +135,7 @@ class TxRunner {
...
@@ -135,7 +135,7 @@ class TxRunner {
executionContext
.
vm
().
stateManager
.
checkpoint
(()
=>
{
})
executionContext
.
vm
().
stateManager
.
checkpoint
(()
=>
{
})
}
}
this
.
checkpointAndCommit
(()
=>
{
executionContext
.
checkpointAndCommit
(()
=>
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
},
function
(
err
,
results
)
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
},
function
(
err
,
results
)
{
err
=
err
?
err
.
message
:
err
err
=
err
?
err
.
message
:
err
if
(
err
)
{
if
(
err
)
{
...
@@ -157,20 +157,7 @@ class TxRunner {
...
@@ -157,20 +157,7 @@ class TxRunner {
transactionHash
:
ethJSUtil
.
bufferToHex
(
Buffer
.
from
(
tx
.
hash
()))
transactionHash
:
ethJSUtil
.
bufferToHex
(
Buffer
.
from
(
tx
.
hash
()))
})
})
})
})
})
},
1
)
}
checkpointAndCommit
(
cb
)
{
if
(
executionContext
.
vm
().
stateManager
.
_checkpointCount
>
1
)
{
return
executionContext
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
}
executionContext
.
vm
().
stateManager
.
checkpoint
(()
=>
{
executionContext
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
})
}
}
runInNode
(
from
,
to
,
data
,
value
,
gasLimit
,
useCall
,
confirmCb
,
gasEstimationForceSend
,
promptCb
,
callback
)
{
runInNode
(
from
,
to
,
data
,
value
,
gasLimit
,
useCall
,
confirmCb
,
gasEstimationForceSend
,
promptCb
,
callback
)
{
...
...
remix-simulator/src/genesis.js
View file @
edd7879f
...
@@ -4,19 +4,6 @@ var executionContext = RemixLib.execution.executionContext
...
@@ -4,19 +4,6 @@ var executionContext = RemixLib.execution.executionContext
var
ethJSUtil
=
require
(
'ethereumjs-util'
)
var
ethJSUtil
=
require
(
'ethereumjs-util'
)
var
BN
=
ethJSUtil
.
BN
var
BN
=
ethJSUtil
.
BN
function
checkpointAndCommit
(
cb
)
{
if
(
executionContext
.
vm
().
stateManager
.
_checkpointCount
>
0
)
{
return
executionContext
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
}
executionContext
.
vm
().
stateManager
.
checkpoint
(()
=>
{
executionContext
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
})
}
function
generateBlock
()
{
function
generateBlock
()
{
var
block
=
new
EthJSBlock
({
var
block
=
new
EthJSBlock
({
header
:
{
header
:
{
...
@@ -30,7 +17,7 @@ function generateBlock () {
...
@@ -30,7 +17,7 @@ function generateBlock () {
uncleHeaders
:
[]
uncleHeaders
:
[]
})
})
checkpointAndCommit
(()
=>
{
executionContext
.
checkpointAndCommit
(()
=>
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
},
function
()
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
},
function
()
{
executionContext
.
addBlock
(
block
)
executionContext
.
addBlock
(
block
)
})
})
...
...
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