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
f36333a9
Commit
f36333a9
authored
Aug 14, 2020
by
aniket-engg
Committed by
Aniket
Aug 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assertion events moved to separate file
parent
d46a6fe3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
assertionEvents.ts
libs/remix-tests/src/assertionEvents.ts
+13
-0
testRunner.ts
libs/remix-tests/src/testRunner.ts
+1
-11
assert_lesserThan_test.sol
libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol
+0
-1
No files found.
libs/remix-tests/src/assertionEvents.ts
0 → 100644
View file @
f36333a9
const
assertionEvents
=
[
{
name
:
'AssertionEvent'
,
params
:
[
'bool'
,
'string'
]
},
{
name
:
'AssertionEventUint'
,
params
:
[
'bool'
,
'string'
,
'uint256'
,
'uint256'
]
}
]
export
default
assertionEvents
\ No newline at end of file
libs/remix-tests/src/testRunner.ts
View file @
f36333a9
import
async
from
'async'
import
async
from
'async'
import
*
as
changeCase
from
'change-case'
import
*
as
changeCase
from
'change-case'
import
Web3
from
'web3'
;
import
Web3
from
'web3'
;
import
assertionEvents
from
'./assertionEvents'
import
{
RunListInterface
,
TestCbInterface
,
TestResultInterface
,
ResultCbInterface
,
import
{
RunListInterface
,
TestCbInterface
,
TestResultInterface
,
ResultCbInterface
,
CompiledContract
,
AstNode
,
Options
,
FunctionDescription
,
UserDocumentation
}
from
'./types'
CompiledContract
,
AstNode
,
Options
,
FunctionDescription
,
UserDocumentation
}
from
'./types'
...
@@ -228,19 +229,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
...
@@ -228,19 +229,8 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
method
.
send
(
sendParams
).
on
(
'receipt'
,
(
receipt
)
=>
{
method
.
send
(
sendParams
).
on
(
'receipt'
,
(
receipt
)
=>
{
try
{
try
{
const
time
:
number
=
(
Date
.
now
()
-
startTime
)
/
1000.0
const
time
:
number
=
(
Date
.
now
()
-
startTime
)
/
1000.0
const
assertionEvents
=
[
{
name
:
'AssertionEvent'
,
params
:
[
'bool'
,
'string'
]
},
{
name
:
'AssertionEventUint'
,
params
:
[
'bool'
,
'string'
,
'uint256'
,
'uint256'
]
}
]
const
assertionEventHashes
=
assertionEvents
.
map
(
e
=>
Web3
.
utils
.
sha3
(
e
.
name
+
'('
+
e
.
params
.
join
()
+
')'
)
)
const
assertionEventHashes
=
assertionEvents
.
map
(
e
=>
Web3
.
utils
.
sha3
(
e
.
name
+
'('
+
e
.
params
.
join
()
+
')'
)
)
let
testPassed
=
false
let
testPassed
=
false
for
(
const
i
in
receipt
.
events
)
{
for
(
const
i
in
receipt
.
events
)
{
const
event
=
receipt
.
events
[
i
]
const
event
=
receipt
.
events
[
i
]
const
eIndex
=
assertionEventHashes
.
indexOf
(
event
.
raw
.
topics
[
0
])
// event name topic will always be at index 0
const
eIndex
=
assertionEventHashes
.
indexOf
(
event
.
raw
.
topics
[
0
])
// event name topic will always be at index 0
...
...
libs/remix-tests/tests/examples_0/assert_lesserThan_test.sol
View file @
f36333a9
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertLesserThanTest {
contract AssertLesserThanTest {
...
...
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