Skip to content

Commit

Permalink
Merge pull request #149 from Concordium/release/election-contract/1.0.0
Browse files Browse the repository at this point in the history
Release/election contract/1.0.0
  • Loading branch information
soerenbf authored Apr 26, 2024
2 parents 29ed2ca + 8639261 commit ee642fe
Show file tree
Hide file tree
Showing 34 changed files with 800 additions and 457 deletions.
2 changes: 1 addition & 1 deletion apps/electionguard-bindings/Cargo.lock

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

2 changes: 1 addition & 1 deletion apps/guardian/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unreleased
## 1.0.0

- Improve dialogue on guardian action modal
- Improve error message when requests to get remote resources fail.
Expand Down
2 changes: 1 addition & 1 deletion apps/guardian/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "guardian",
"private": true,
"version": "0.1.2",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion apps/guardian/src-tauri/Cargo.lock

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

5 changes: 3 additions & 2 deletions apps/guardian/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1233,13 +1233,14 @@ async fn generate_decryption_proofs(
.as_ref()
.context("Could not find encrypted tally in app state")?;

// Find all decryption shares for all guardians. If the shares registered by a
// specific guardian cannot be decoded, return
// Find all decryption shares for all included guardians. If the shares
// registered by a specific guardian cannot be decoded, return
// `Error::InvalidDecryptionShare`. If the shares are missing, exclude them from
// the shares used.
let decryption_shares: Vec<_> = contract_data
.guardians
.iter()
.filter(|(_, guardian_state)| !guardian_state.excluded)
.filter_map(|(_, guardian_state)| guardian_state.decryption_share.as_ref())
.map(|bytes| {
decode::<GuardianDecryption>(bytes).map_err(|_| {
Expand Down
2 changes: 1 addition & 1 deletion apps/guardian/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "Concordium Election Guardian",
"version": "0.1.2"
"version": "1.0.0"
},
"tauri": {
"allowlist": {
Expand Down
6 changes: 3 additions & 3 deletions apps/guardian/src/pages/Actions/DecryptionActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const GenerateDecryptionProof = makeActionableStep(

export function DecryptionActions() {
const electionStep = useAtomValue(electionStepAtom);
const { guardians } = useAtomValue(guardiansStateAtom);
const guardians = useAtomValue(guardiansStateAtom).guardians?.filter(([, g]) => !g.excluded);
const electionConfig = useAtomValue(electionConfigAtom);

if (electionStep?.phase !== ElectionPhase.Tally || guardians === undefined || electionConfig === undefined) {
Expand All @@ -173,7 +173,7 @@ export function DecryptionActions() {
{step === TallyStep.GenerateDecryptionShare && <GenerateDecryptionShare />}
{step === TallyStep.AwaitPeerShares && (
<AwaitPeers
guardians={guardians.filter(([, gs]) => !gs.excluded)}
guardians={guardians}
predicate={(g) => g.hasDecryptionShare}
note={
<>
Expand All @@ -191,7 +191,7 @@ export function DecryptionActions() {
<h3>The decryption was not completed by a sufficient amount of guardians</h3>
)}
{step === TallyStep.GenerateDecryptionProof && <GenerateDecryptionProof />}
{step === TallyStep.AwaitPeerShares && (
{step === TallyStep.AwaitPeerProofs && (
<AwaitPeers
predicate={(g) => g.hasDecryptionProof}
guardians={guardians.filter(([, gs]) => gs.hasDecryptionShare)}
Expand Down
2 changes: 1 addition & 1 deletion apps/guardian/src/shared/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const electionStepAtom = atom<ElectionStep | undefined, [], void>(
const includedGuardians = guardians.filter((g) => !g.excluded);
const step = (() => {
if (includedGuardians.every((g) => g.hasDecryptionShare && g.hasDecryptionProof)) return TallyStep.Done;
if (guardian.hasDecryptionShare && guardian.hasDecryptionProof) return TallyStep.AwaitPeerShares;
if (guardian.hasDecryptionShare && guardian.hasDecryptionProof) return TallyStep.AwaitPeerProofs;
if (
electionConfig.decryptionDeadline < now &&
includedGuardians.filter((g) => g.hasDecryptionShare).length < electionConfig.guardianThreshold
Expand Down

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

90 changes: 55 additions & 35 deletions apps/shared/__generated__/election-contract/module.ts

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

Loading

0 comments on commit ee642fe

Please sign in to comment.