Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toheeb #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const stdlib = loadStdlib(process.env);

const startingBalance = stdlib.parseCurrency(100);

const accGovernor=await stdlib.newTestAccount(2, startingBalance);
const accGovernor= await stdlib.newTestAccount(2, startingBalance);
console.log('Hello, Alice and Bob!');

console.log('Launching...');
Expand All @@ -17,8 +17,8 @@ console.log('Starting backends...');
const voters=[]
const startingVoting=()=>{

const acc =await stdlib.newTestAccount(startingBalance)
const ctc=acc.Contract(backend,ctcGovernor.getInfo())
const acc = await stdlib.newTestAccount(startingBalance)
const ctc = acc.Contract(backend,ctcGovernor.getInfo())
voters
}

Expand Down
4 changes: 3 additions & 1 deletion index.rsh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const main = Reach.App(() => {
.invariant(balance() == (voteFor + voteAgainst) * ticketPrice)
.while(keepGoing())
.api_(Voter.vote, (vote) => {
return [0, (k) => {
return [ticketPrice, (k) => {
const [nF, nA] = vote ? [1, 0] : [0, 1]
return [voteFor + nF, voteAgainst + nA]
}]
Expand All @@ -69,5 +69,7 @@ export const main = Reach.App(() => {
const [ [], k ] = call(Voter.showOutcome);
k(outcome);
commit()
transfe(balance()).to(Governor);
commit();
exit();
});