Skip to content

Commit

Permalink
Remove some unused code (#295)
Browse files Browse the repository at this point in the history
* remove hard coded key

* remove unused config key
  • Loading branch information
av-martin authored May 10, 2024
1 parent f8d7cf7 commit 90afc14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
17 changes: 4 additions & 13 deletions lib/av_client/election_config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
import { BulletinBoard } from "./connectors/bulletin_board";
import { LatestConfig } from "./types";
import { InvalidConfigError } from "./errors";
import {BulletinBoard} from "./connectors/bulletin_board";
import {LatestConfig} from "./types";
import {InvalidConfigError} from "./errors";

export async function fetchLatestConfig(bulletinBoard: BulletinBoard): Promise<LatestConfig> {
return bulletinBoard.getLatestConfig()
.then(
(response: { data: LatestConfig }) => {
const configData = response.data;

// const privKey = 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'
const pubKey = '03e9858b6e48eb93d8f27aa76b60806298c4c7dd94077ad6c3ff97c44937888647'
configData.affidavit = {
curve: 'k256',
encryptionKey: pubKey
}

return configData;
return response.data;
})
.catch((error) => {
console.error()
Expand Down
6 changes: 0 additions & 6 deletions lib/av_client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,6 @@ export type BallotStatus = {
}
}

export interface AffidavitConfig {
curve: string;
encryptionKey: string;
}

export type BallotSelection = {
reference: string
contestSelections: ContestSelection[]
Expand Down Expand Up @@ -279,7 +274,6 @@ export type ReadableOptionSelection = {
export interface LatestConfig {
items: LatestConfigItems
receipt?: string
affidavit?: AffidavitConfig
}

export interface LatestConfigItems {
Expand Down

0 comments on commit 90afc14

Please sign in to comment.