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
12ff79a1
Commit
12ff79a1
authored
Jun 15, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix remix-tests; fix commit condition
parent
002eb5e2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
8 deletions
+15
-8
txRunner.js
remix-lib/src/execution/txRunner.js
+7
-5
genesis.js
remix-simulator/src/genesis.js
+1
-1
blocks.js
remix-simulator/test/blocks.js
+1
-1
testRunner.ts
remix-tests/src/testRunner.ts
+1
-0
testRunner.ts
remix-tests/tests/testRunner.ts
+5
-1
No files found.
remix-lib/src/execution/txRunner.js
View file @
12ff79a1
...
...
@@ -104,7 +104,7 @@ class TxRunner {
timestamp
:
timestamp
,
nonce
:
new
BN
(
account
.
nonce
++
),
gasPrice
:
new
BN
(
1
),
gasLimit
:
new
BN
(
gasLimit
,
10
)
,
gasLimit
:
gasLimit
,
to
:
to
,
value
:
new
BN
(
value
,
10
),
data
:
Buffer
.
from
(
data
.
slice
(
2
),
'hex'
)
...
...
@@ -119,7 +119,7 @@ class TxRunner {
number
:
self
.
blockNumber
,
coinbase
:
coinbases
[
self
.
blockNumber
%
coinbases
.
length
],
difficulty
:
difficulties
[
self
.
blockNumber
%
difficulties
.
length
],
gasLimit
:
new
BN
(
'
5
000000'
).
imuln
(
1
)
gasLimit
:
new
BN
(
'
8
000000'
).
imuln
(
1
)
},
transactions
:
[
tx
],
uncleHeaders
:
[]
...
...
@@ -132,12 +132,14 @@ class TxRunner {
this
.
checkpointAndCommit
(()
=>
{
executionContext
.
vm
().
runBlock
({
block
:
block
,
generate
:
true
,
skipBlockValidation
:
true
,
skipBalance
:
false
},
function
(
err
,
results
)
{
err
=
err
?
err
.
message
:
err
if
(
err
)
{
return
callback
(
err
)
}
let
result
=
results
.
results
[
0
]
console
.
dir
(
result
)
if
(
useCall
)
{
executionContext
.
vm
().
stateManager
.
revert
(
function
()
{
})
}
err
=
err
?
err
.
message
:
err
if
(
result
)
{
result
.
status
=
'0x'
+
result
.
vm
.
exception
.
toString
(
16
)
}
...
...
@@ -154,7 +156,7 @@ class TxRunner {
}
checkpointAndCommit
(
cb
)
{
if
(
executionContext
.
vm
().
stateManager
.
_checkpointCount
>
0
)
{
if
(
executionContext
.
vm
().
stateManager
.
_checkpointCount
>
1
)
{
return
executionContext
.
vm
().
stateManager
.
commit
(()
=>
{
cb
()
})
...
...
remix-simulator/src/genesis.js
View file @
12ff79a1
...
...
@@ -24,7 +24,7 @@ function generateBlock () {
number
:
1
,
coinbase
:
'0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a'
,
difficulty
:
(
new
BN
(
'69762765929000'
,
10
)),
gasLimit
:
new
BN
(
'
5
000000'
).
imuln
(
1
)
gasLimit
:
new
BN
(
'
8
000000'
).
imuln
(
1
)
},
transactions
:
[],
uncleHeaders
:
[]
...
...
remix-simulator/test/blocks.js
View file @
12ff79a1
...
...
@@ -18,7 +18,7 @@ describe('blocks', function () {
let
expectedBlock
=
{
difficulty
:
'69762765929000'
,
extraData
:
'0x0'
,
gasLimit
:
5
000000
,
gasLimit
:
8
000000
,
gasUsed
:
0
,
hash
:
block
.
hash
.
toString
(
'hex'
),
logsBloom
:
'0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
,
...
...
remix-tests/src/testRunner.ts
View file @
12ff79a1
...
...
@@ -76,6 +76,7 @@ export function runTest (testName, testObject: any, contractDetails: any, opts:
value
:
testName
,
filename
:
testObject
.
filename
}
testCallback
(
undefined
,
resp
)
async
.
eachOfLimit
(
runList
,
1
,
function
(
func
,
index
,
next
)
{
let
sender
...
...
remix-tests/tests/testRunner.ts
View file @
12ff79a1
...
...
@@ -9,15 +9,18 @@ import { deployAll } from '../dist/deployer'
import
{
runTest
}
from
'../dist/index'
import
{
ResultsInterface
,
TestCbInterface
,
ResultCbInterface
}
from
'../dist/index'
var
provider
=
new
Provider
()
function
compileAndDeploy
(
filename
:
string
,
callback
:
Function
)
{
let
web3
:
Web3
=
new
Web3
()
web3
.
setProvider
(
new
Provider
()
)
web3
.
setProvider
(
provider
)
let
compilationData
:
object
let
accounts
:
string
[]
async
.
waterfall
([
function
getAccountList
(
next
:
Function
):
void
{
web3
.
eth
.
getAccounts
((
_err
:
Error
|
null
|
undefined
,
_accounts
:
string
[])
=>
{
accounts
=
_accounts
web3
.
eth
.
defaultAccount
=
accounts
[
0
]
next
(
_err
)
})
},
...
...
@@ -93,6 +96,7 @@ describe('testRunner', () => {
results
=
_results
done
()
}
runTest
(
'MyTest'
,
contracts
.
MyTest
,
compilationData
[
filename
][
'MyTest'
],
{
accounts
},
testCallback
,
resultsCallback
)
})
})
...
...
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