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
6acf1021
Commit
6acf1021
authored
Aug 28, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for misc endpoints
parent
9ef716ff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
3 deletions
+59
-3
misc.js
remix-simulator/test/misc.js
+59
-3
No files found.
remix-simulator/test/misc.js
View file @
6acf1021
...
@@ -10,8 +10,9 @@ describe('Misc', function () {
...
@@ -10,8 +10,9 @@ describe('Misc', function () {
web3
.
setProvider
(
provider
)
web3
.
setProvider
(
provider
)
})
})
describe
(
'web3_clientVersion'
,
()
=>
{
it
(
'should get correct remix simulator version'
,
async
function
(
done
)
{
it
(
'should get correct remix simulator version'
,
async
function
(
done
)
{
web3
.
_requestManager
.
send
({
method
:
'web3_clientVersion'
,
params
:
[]
},
(
err
,
version
)
=>
{
web3
.
_requestManager
.
send
({
method
:
'web3_clientVersion'
,
params
:
[]
},
(
err
,
version
)
=>
{
if
(
err
)
{
if
(
err
)
{
throw
new
Error
(
err
)
throw
new
Error
(
err
)
}
}
...
@@ -20,37 +21,92 @@ describe('Misc', function () {
...
@@ -20,37 +21,92 @@ describe('Misc', function () {
done
()
done
()
})
})
})
})
})
describe
(
'eth_protocolVersion'
,
()
=>
{
it
(
'should get protocol version'
,
async
function
()
{
it
(
'should get protocol version'
,
async
function
()
{
web3
.
_requestManager
.
send
({
method
:
'eth_protocolVersion'
,
params
:
[]
},
(
err
,
result
)
=>
{
web3
.
_requestManager
.
send
({
method
:
'eth_protocolVersion'
,
params
:
[]
},
(
err
,
result
)
=>
{
if
(
err
)
{
if
(
err
)
{
throw
new
Error
(
err
)
throw
new
Error
(
err
)
}
}
assert
.
equal
(
result
,
'0x3f'
)
assert
.
equal
(
result
,
'0x3f'
)
})
})
})
})
})
describe
(
'eth_syncing'
,
()
=>
{
it
(
'should get if is syncing'
,
async
function
()
{
it
(
'should get if is syncing'
,
async
function
()
{
let
isSyncing
=
await
web3
.
eth
.
isSyncing
()
let
isSyncing
=
await
web3
.
eth
.
isSyncing
()
assert
.
equal
(
isSyncing
,
false
)
assert
.
equal
(
isSyncing
,
false
)
})
})
})
describe
(
'eth_mining'
,
()
=>
{
it
(
'should get if is mining'
,
async
function
()
{
it
(
'should get if is mining'
,
async
function
()
{
let
isMining
=
await
web3
.
eth
.
isMining
()
let
isMining
=
await
web3
.
eth
.
isMining
()
assert
.
equal
(
isMining
,
false
)
assert
.
equal
(
isMining
,
false
)
})
})
})
describe
(
'eth_hashrate'
,
()
=>
{
it
(
'should get hashrate'
,
async
function
()
{
it
(
'should get hashrate'
,
async
function
()
{
let
hashrate
=
await
web3
.
eth
.
getHashrate
()
let
hashrate
=
await
web3
.
eth
.
getHashrate
()
assert
.
equal
(
hashrate
,
0
)
assert
.
equal
(
hashrate
,
0
)
})
})
})
describe
(
'web3_sha3'
,
()
=>
{
it
(
'should get result of a sha3'
,
async
function
()
{
it
(
'should get result of a sha3'
,
async
function
()
{
web3
.
_requestManager
.
send
({
method
:
'web3_sha3'
,
params
:
[
'0x68656c6c6f20776f726c64'
]
},
(
err
,
result
)
=>
{
web3
.
_requestManager
.
send
({
method
:
'web3_sha3'
,
params
:
[
'0x68656c6c6f20776f726c64'
]
},
(
err
,
result
)
=>
{
if
(
err
)
{
if
(
err
)
{
throw
new
Error
(
err
)
throw
new
Error
(
err
)
}
}
assert
.
equal
(
result
,
'0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad'
)
assert
.
equal
(
result
,
'0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad'
)
})
})
})
})
})
describe
(
'eth_getCompilers'
,
()
=>
{
it
(
'should get list of compilers'
,
async
function
()
{
web3
.
_requestManager
.
send
({
method
:
'eth_getCompilers'
,
params
:
[]
},
(
err
,
result
)
=>
{
if
(
err
)
{
throw
new
Error
(
err
)
}
assert
.
equal
(
result
,
0
)
})
})
})
describe
(
'eth_compileSolidity'
,
()
=>
{
it
(
'get unsupported result when requesting solidity compiler'
,
async
function
()
{
web3
.
_requestManager
.
send
({
method
:
'eth_compileSolidity'
,
params
:
[]
},
(
err
,
result
)
=>
{
if
(
err
)
{
throw
new
Error
(
err
)
}
assert
.
equal
(
result
,
'unsupported'
)
})
})
})
describe
(
'eth_compileLLL'
,
()
=>
{
it
(
'get unsupported result when requesting LLL compiler'
,
async
function
()
{
web3
.
_requestManager
.
send
({
method
:
'eth_compileLLL'
,
params
:
[]
},
(
err
,
result
)
=>
{
if
(
err
)
{
throw
new
Error
(
err
)
}
assert
.
equal
(
result
,
'unsupported'
)
})
})
})
describe
(
'eth_compileSerpent'
,
()
=>
{
it
(
'get unsupported result when requesting serpent compiler'
,
async
function
()
{
web3
.
_requestManager
.
send
({
method
:
'eth_compileSerpent'
,
params
:
[]
},
(
err
,
result
)
=>
{
if
(
err
)
{
throw
new
Error
(
err
)
}
assert
.
equal
(
result
,
'unsupported'
)
})
})
})
})
})
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