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
1ad9ecec
Commit
1ad9ecec
authored
Oct 25, 2016
by
Lapo Luchini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement steadily increasing `block.number`.
This allows testing contracts that assume it is an increasing unique value.
parent
373be1c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
universal-dapp.js
src/universal-dapp.js
+7
-2
No files found.
src/universal-dapp.js
View file @
1ad9ecec
...
...
@@ -49,6 +49,7 @@ UniversalDApp.prototype.reset = function (contracts, getAddress, getValue, getGa
this
.
_addAccount
(
'dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a'
);
this
.
_addAccount
(
'd74aa6d18aa79a05f3473dd030a97d3305737cbc8337d940344345c1f6b72eea'
);
this
.
_addAccount
(
'71975fbf7fe448e004ac7ae54cad0a383c3906055a65468714156a07385e96ce'
);
this
.
blockNumber
=
1150000
;
// The VM is running in Homestead mode, which started at this block.
}
};
...
...
@@ -749,12 +750,16 @@ UniversalDApp.prototype.runTx = function (args, cb) {
tx
.
sign
(
account
.
privateKey
);
var
block
=
new
EthJSBlock
({
header
:
{
// FIXME: support coinbase, difficulty, number and gasLimit
timestamp
:
new
Date
().
getTime
()
/
1000
|
0
// FIXME: support coinbase, difficulty and gasLimit
timestamp
:
new
Date
().
getTime
()
/
1000
|
0
,
number
:
self
.
blockNumber
},
transactions
:
[],
uncleHeaders
:
[]
});
if
(
!
args
.
useCall
)
{
++
self
.
blockNumber
;
}
self
.
vm
.
runTx
({
block
:
block
,
tx
:
tx
,
skipBalance
:
true
,
skipNonce
:
true
},
function
(
err
,
result
)
{
result
.
transactionHash
=
self
.
txdebugger
.
web3
().
releaseCurrentHash
();
// used to keep track of the transaction
cb
(
err
,
result
);
...
...
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