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
eef41d5f
Commit
eef41d5f
authored
Jan 03, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
b1f48bef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
localDecoder.js
remix-solidity/test/decoder/localDecoder.js
+3
-1
mapping.js
remix-solidity/test/decoder/stateTests/mapping.js
+4
-5
vmCall.js
remix-solidity/test/decoder/vmCall.js
+1
-2
No files found.
remix-solidity/test/decoder/localDecoder.js
View file @
eef41d5f
...
@@ -32,7 +32,9 @@ function test (st, vm, privateKey) {
...
@@ -32,7 +32,9 @@ function test (st, vm, privateKey) {
misc2LocalTest
(
st
,
vm
,
privateKey
,
output
.
contracts
[
'test.sol'
][
'miscLocal2'
].
evm
.
bytecode
.
object
,
output
,
function
()
{
misc2LocalTest
(
st
,
vm
,
privateKey
,
output
.
contracts
[
'test.sol'
][
'miscLocal2'
].
evm
.
bytecode
.
object
,
output
,
function
()
{
output
=
compiler
.
compileStandardWrapper
(
compilerInput
(
structArrayLocal
.
contract
))
output
=
compiler
.
compileStandardWrapper
(
compilerInput
(
structArrayLocal
.
contract
))
output
=
JSON
.
parse
(
output
)
output
=
JSON
.
parse
(
output
)
structArrayLocalTest
(
st
,
vm
,
privateKey
,
output
.
contracts
[
'test.sol'
][
'structArrayLocal'
].
evm
.
bytecode
.
object
,
output
,
function
()
{})
structArrayLocalTest
(
st
,
vm
,
privateKey
,
output
.
contracts
[
'test.sol'
][
'structArrayLocal'
].
evm
.
bytecode
.
object
,
output
,
function
()
{
st
.
end
()
})
})
})
})
})
})
})
...
...
remix-solidity/test/decoder/stateTests/mapping.js
View file @
eef41d5f
...
@@ -17,12 +17,10 @@ module.exports = function testMappingStorage (st, cb) {
...
@@ -17,12 +17,10 @@ module.exports = function testMappingStorage (st, cb) {
}
else
{
}
else
{
remixLib
.
global
.
web3
.
eth
.
getTransaction
(
txHash
,
(
error
,
tx
)
=>
{
remixLib
.
global
.
web3
.
eth
.
getTransaction
(
txHash
,
(
error
,
tx
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
st
.
end
(
error
)
st
.
end
(
error
)
}
else
{
}
else
{
testMapping
(
st
,
vm
,
privateKey
,
tx
.
contractAddress
,
output
,
(
error
)
=>
{
testMapping
(
st
,
vm
,
privateKey
,
tx
.
contractAddress
,
output
,
cb
)
st
.
end
(
error
)
cb
()
})
}
}
})
})
}
}
...
@@ -39,6 +37,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
...
@@ -39,6 +37,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
console
.
log
(
txHash
)
console
.
log
(
txHash
)
remixLib
.
global
.
web3
.
eth
.
getTransaction
(
txHash
,
(
error
,
tx
)
=>
{
remixLib
.
global
.
web3
.
eth
.
getTransaction
(
txHash
,
(
error
,
tx
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
st
.
end
(
error
)
st
.
end
(
error
)
}
else
{
}
else
{
var
TraceManager
=
require
(
'remix-core'
).
trace
.
TraceManager
var
TraceManager
=
require
(
'remix-core'
).
trace
.
TraceManager
...
@@ -62,7 +61,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
...
@@ -62,7 +61,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
st
.
equal
(
result
[
'_iBreakSolidityStateInt'
].
type
,
'mapping(uint256 => uint256)'
)
st
.
equal
(
result
[
'_iBreakSolidityStateInt'
].
type
,
'mapping(uint256 => uint256)'
)
st
.
equal
(
result
[
'_iBreakSolidityStateInt'
].
value
[
'0000000000000000000000000000000000000000000000000000000000000001'
].
value
,
'1'
)
st
.
equal
(
result
[
'_iBreakSolidityStateInt'
].
value
[
'0000000000000000000000000000000000000000000000000000000000000001'
].
value
,
'1'
)
st
.
equal
(
result
[
'_iBreakSolidityStateInt'
].
value
[
'0000000000000000000000000000000000000000000000000000000000000001'
].
type
,
'uint256'
)
st
.
equal
(
result
[
'_iBreakSolidityStateInt'
].
value
[
'0000000000000000000000000000000000000000000000000000000000000001'
].
type
,
'uint256'
)
// st.end
()
cb
()
},
(
reason
)
=>
{
},
(
reason
)
=>
{
console
.
log
(
'fail'
)
console
.
log
(
'fail'
)
st
.
end
(
reason
)
st
.
end
(
reason
)
...
...
remix-solidity/test/decoder/vmCall.js
View file @
eef41d5f
...
@@ -3,6 +3,7 @@ var utileth = require('ethereumjs-util')
...
@@ -3,6 +3,7 @@ var utileth = require('ethereumjs-util')
var
Tx
=
require
(
'ethereumjs-tx'
)
var
Tx
=
require
(
'ethereumjs-tx'
)
var
Block
=
require
(
'ethereumjs-block'
)
var
Block
=
require
(
'ethereumjs-block'
)
var
BN
=
require
(
'ethereumjs-util'
).
BN
var
BN
=
require
(
'ethereumjs-util'
).
BN
var
remixLib
=
require
(
'remix-lib'
)
function
sendTx
(
vm
,
from
,
to
,
value
,
data
,
cb
)
{
function
sendTx
(
vm
,
from
,
to
,
value
,
data
,
cb
)
{
var
tx
=
new
Tx
({
var
tx
=
new
Tx
({
...
@@ -33,7 +34,6 @@ function sendTx (vm, from, to, value, data, cb) {
...
@@ -33,7 +34,6 @@ function sendTx (vm, from, to, value, data, cb) {
Init VM / Send Transaction
Init VM / Send Transaction
*/
*/
function
initVM
(
st
,
privateKey
)
{
function
initVM
(
st
,
privateKey
)
{
var
remixLib
=
require
(
'remix-lib'
)
var
utileth
=
require
(
'ethereumjs-util'
)
var
utileth
=
require
(
'ethereumjs-util'
)
var
VM
=
require
(
'ethereumjs-vm'
)
var
VM
=
require
(
'ethereumjs-vm'
)
var
Web3Providers
=
remixLib
.
vm
.
Web3Providers
var
Web3Providers
=
remixLib
.
vm
.
Web3Providers
...
@@ -52,7 +52,6 @@ function initVM (st, privateKey) {
...
@@ -52,7 +52,6 @@ function initVM (st, privateKey) {
st
.
fail
(
mes
)
st
.
fail
(
mes
)
}
else
{
}
else
{
remixLib
.
global
.
web3
=
obj
remixLib
.
global
.
web3
=
obj
st
.
end
()
}
}
})
})
return
vm
return
vm
...
...
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