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
baa121cf
Commit
baa121cf
authored
Jun 01, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ballot_test
parent
46f4feb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
app.js
src/app.js
+2
-0
example-contracts.js
src/app/editor/example-contracts.js
+26
-1
No files found.
src/app.js
View file @
baa121cf
...
...
@@ -629,6 +629,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
if
(
Object
.
keys
(
filesList
).
length
===
0
)
{
if
(
!
filesProviders
[
'browser'
].
set
(
examples
.
ballot
.
name
,
examples
.
ballot
.
content
))
{
modalDialogCustom
.
alert
(
'Failed to store example contract in browser. Remix will not work properly. Please ensure Remix has access to LocalStorage. Safari in Private mode is known not to work.'
)
}
else
{
filesProviders
[
'browser'
].
set
(
examples
.
ballot_test
.
name
,
examples
.
ballot_test
.
content
)
}
}
})
...
...
src/app/editor/example-contracts.js
View file @
baa121cf
...
...
@@ -66,6 +66,31 @@ contract Ballot {
}
}`
var
ballotTest
=
`pragma solidity ^0.4.7;
import "./remix_tests.sol"; // this import is automatically injected by Remix.
import "./ballot.sol";
contract test3 {
Ballot ballotToTest;
function beforeAll () {
bytes32[] proposals;
proposals.push(0xabcd);
ballotToTest = new Ballot(proposals);
}
function checkWinningProposal () public {
ballotToTest.vote(1);
Assert.equal(ballotToTest.winningProposal(), uint(1), "1 should be the winning proposal");
}
function checkWinninProposalWithReturnValue () public constant returns (bool) {
return ballotToTest.winningProposal() == 1;
}
}
`
module
.
exports
=
{
ballot
:
{
name
:
'ballot.sol'
,
content
:
ballot
}
ballot
:
{
name
:
'ballot.sol'
,
content
:
ballot
},
ballot_test
:
{
name
:
'ballot_test.sol'
,
content
:
ballotTest
}
}
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