Skip to content

Commit

Permalink
adding script to configure fresh election
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Nov 28, 2023
1 parent a691113 commit 89382da
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 18 deletions.
21 changes: 19 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"version": 1,
"deployAliases": {}
}
"deployAliases": {
"berkeleyx": {
"url": "https://proxy.berkeley.minaexplorer.com/graphql",
"keyPath": "keys/berkeley.json",
"feepayerKeyPath": "/Users/cobydurling/.cache/zkapp-cli/keys/berkeley-deployer.json",
"feepayerAlias": "berkeley-deployer",
"fee": "0.1",
"smartContract": "TokenElection"
},
"berkeley": {
"url": "https://proxy.berkeley.minaexplorer.com/graphql",
"keyPath": "keys/berkeley.json",
"feepayerKeyPath": "/Users/cobydurling/.cache/zkapp-cli/keys/berkeley-deployer.json",
"feepayerAlias": "berkeley-deployer",
"fee": "0.1",
"smartContract": "TokenElection"
}
}
}
10 changes: 4 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@
"ts-jest": "^27.0.7",
"typescript": "^4.7.2"
},
"peerDependencies": {
"o1js": "0.14.*"
},
"dependencies": {
"o1js": "^0.14.2",
"o1js-pack": "^0.4.3",
"zkapp-cli": "^0.15.*"
}
Expand Down
Empty file added src/ElectionFactory.ts
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Ballot, PartialBallot, TokenElection } from './TokenElection';
import { Ballot, PartialBallot, TokenElection } from './BaseTokenElection';
import { AccountUpdate, Mina, PrivateKey, PublicKey, UInt32 } from 'o1js';

describe("TokenElection", () => {
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions src/TokenElection/WhitelistTokenElection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { TokenElection } from "./BaseTokenElection";

class WhitelistTokenElection extends TokenElection {

}
2 changes: 1 addition & 1 deletion src/examples/ZkIgnite/getElectionDetails.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Mina, PublicKey, fetchAccount } from 'o1js';
import { TokenElection, IpfsHash } from './../../TokenElection.js';
import { TokenElection, IpfsHash } from '../../TokenElection/BaseTokenElection.js';

import * as readline from 'node:readline/promises'; // This uses the promise-based APIs
import { stdin as input, stdout as output } from 'node:process';
Expand Down
2 changes: 1 addition & 1 deletion src/examples/ZkIgnite/joinElection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountUpdate, Mina, PrivateKey, PublicKey, fetchAccount } from 'o1js';
import { TokenElection, IpfsHash } from './../../TokenElection.js';
import { TokenElection, IpfsHash } from '../../TokenElection/BaseTokenElection.js';
import fs from 'fs/promises';

import * as readline from 'node:readline/promises'; // This uses the promise-based APIs
Expand Down
2 changes: 1 addition & 1 deletion src/examples/ZkIgnite/reduceVotes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountUpdate, Mina, PrivateKey, PublicKey, UInt32, fetchAccount, setArchiveGraphqlEndpoint } from 'o1js';
import { TokenElection, IpfsHash, PartialBallot, Ballot } from './../../TokenElection.js';
import { TokenElection, IpfsHash, PartialBallot, Ballot } from '../../TokenElection/BaseTokenElection.js';
import fs from 'fs/promises';

import * as readline from 'node:readline/promises'; // This uses the promise-based APIs
Expand Down
2 changes: 1 addition & 1 deletion src/examples/ZkIgnite/submitVotes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountUpdate, Mina, PrivateKey, PublicKey, UInt32, fetchAccount, setArchiveGraphqlEndpoint } from 'o1js';
import { TokenElection, IpfsHash, PartialBallot, Ballot } from './../../TokenElection.js';
import { TokenElection, IpfsHash, PartialBallot, Ballot } from '../../TokenElection/BaseTokenElection.js';
import fs from 'fs/promises';

import * as readline from 'node:readline/promises'; // This uses the promise-based APIs
Expand Down
4 changes: 2 additions & 2 deletions src/set_election_details.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const ELECTION_DETAILS_KEY = 'QmPKD74Pfc6aH5Suh1EXqjbfKBYDs5QVARxmpqsNKMKxe3';
const ELECTION_DETAILS_KEY = 'Qmc8yEQqnYzrAhGSJgjLLyTSUxtsZmxn1grtwVATPSpS4E';

import { Mina, PrivateKey } from 'o1js';
import fs from 'fs/promises';
import { TokenElection, IpfsHash } from './TokenElection.js';
import { TokenElection, IpfsHash } from './TokenElection/BaseTokenElection.js';

// check command line arg
let deployAlias = process.argv[2];
Expand Down

0 comments on commit 89382da

Please sign in to comment.