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
db77e930
Unverified
Commit
db77e930
authored
Feb 11, 2019
by
yann300
Committed by
GitHub
Feb 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1120 from LeviBarnes/master
Allow timestamps to be passed to rawRun
parents
c726b3be
989b6b04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
txRunner.js
remix-lib/src/execution/txRunner.js
+9
-4
No files found.
remix-lib/src/execution/txRunner.js
View file @
db77e930
...
@@ -22,7 +22,11 @@ class TxRunner {
...
@@ -22,7 +22,11 @@ class TxRunner {
}
}
rawRun
(
args
,
confirmationCb
,
gasEstimationForceSend
,
promptCb
,
cb
)
{
rawRun
(
args
,
confirmationCb
,
gasEstimationForceSend
,
promptCb
,
cb
)
{
run
(
this
,
args
,
Date
.
now
(),
confirmationCb
,
gasEstimationForceSend
,
promptCb
,
cb
)
var
timestamp
=
Date
.
now
()
if
(
args
.
timestamp
)
{
timestamp
=
args
.
timestamp
}
run
(
this
,
args
,
timestamp
,
confirmationCb
,
gasEstimationForceSend
,
promptCb
,
cb
)
}
}
_executeTx
(
tx
,
gasPrice
,
api
,
promptCb
,
callback
)
{
_executeTx
(
tx
,
gasPrice
,
api
,
promptCb
,
callback
)
{
...
@@ -81,20 +85,21 @@ class TxRunner {
...
@@ -81,20 +85,21 @@ class TxRunner {
self
.
runInNode
(
args
.
from
,
args
.
to
,
data
,
args
.
value
,
args
.
gasLimit
,
args
.
useCall
,
confirmationCb
,
gasEstimationForceSend
,
promptCb
,
callback
)
self
.
runInNode
(
args
.
from
,
args
.
to
,
data
,
args
.
value
,
args
.
gasLimit
,
args
.
useCall
,
confirmationCb
,
gasEstimationForceSend
,
promptCb
,
callback
)
}
else
{
}
else
{
try
{
try
{
self
.
runInVm
(
args
.
from
,
args
.
to
,
data
,
args
.
value
,
args
.
gasLimit
,
args
.
useCall
,
callback
)
self
.
runInVm
(
args
.
from
,
args
.
to
,
data
,
args
.
value
,
args
.
gasLimit
,
args
.
useCall
,
args
.
timestamp
,
callback
)
}
catch
(
e
)
{
}
catch
(
e
)
{
callback
(
e
,
null
)
callback
(
e
,
null
)
}
}
}
}
}
}
runInVm
(
from
,
to
,
data
,
value
,
gasLimit
,
useCall
,
callback
)
{
runInVm
(
from
,
to
,
data
,
value
,
gasLimit
,
useCall
,
timestamp
,
callback
)
{
const
self
=
this
const
self
=
this
var
account
=
self
.
vmaccounts
[
from
]
var
account
=
self
.
vmaccounts
[
from
]
if
(
!
account
)
{
if
(
!
account
)
{
return
callback
(
'Invalid account selected'
)
return
callback
(
'Invalid account selected'
)
}
}
var
tx
=
new
EthJSTX
({
var
tx
=
new
EthJSTX
({
timestamp
:
timestamp
,
nonce
:
new
BN
(
account
.
nonce
++
),
nonce
:
new
BN
(
account
.
nonce
++
),
gasPrice
:
new
BN
(
1
),
gasPrice
:
new
BN
(
1
),
gasLimit
:
new
BN
(
gasLimit
,
10
),
gasLimit
:
new
BN
(
gasLimit
,
10
),
...
@@ -108,7 +113,7 @@ class TxRunner {
...
@@ -108,7 +113,7 @@ class TxRunner {
const
difficulties
=
[
new
BN
(
'69762765929000'
,
10
),
new
BN
(
'70762765929000'
,
10
),
new
BN
(
'71762765929000'
,
10
)
]
const
difficulties
=
[
new
BN
(
'69762765929000'
,
10
),
new
BN
(
'70762765929000'
,
10
),
new
BN
(
'71762765929000'
,
10
)
]
var
block
=
new
EthJSBlock
({
var
block
=
new
EthJSBlock
({
header
:
{
header
:
{
timestamp
:
new
Date
().
getTime
()
/
1000
|
0
,
timestamp
:
timestamp
||
(
new
Date
().
getTime
()
/
1000
|
0
)
,
number
:
self
.
blockNumber
,
number
:
self
.
blockNumber
,
coinbase
:
coinbases
[
self
.
blockNumber
%
coinbases
.
length
],
coinbase
:
coinbases
[
self
.
blockNumber
%
coinbases
.
length
],
difficulty
:
difficulties
[
self
.
blockNumber
%
difficulties
.
length
],
difficulty
:
difficulties
[
self
.
blockNumber
%
difficulties
.
length
],
...
...
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