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

Add candidate id to option #296

Merged
merged 5 commits into from
May 17, 2024
Merged
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
5 changes: 5 additions & 0 deletions lib/av_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { KeyPair, Affidavit, VerifierItem, CommitmentOpening, SpoilRequestItem,
import { randomKeyPair } from './av_client/generate_key_pair';
import { generateReceipt } from './av_client/generate_receipt';
import { Buffer } from 'buffer'
import * as Crypto from "../lib/av_client/aion_crypto.js"
import jwtDecode, { JwtPayload } from "jwt-decode";

import {
Expand Down Expand Up @@ -607,6 +608,10 @@ export class AVClient implements IAVClient {
return this.keyPair.privateKey
}

public generateSignature(payload: string): string {
return Crypto.generateSchnorrSignature(payload, this.privateKey())
}

/**
* Registers a voter by proof of identity
* Used when the authorization mode of the Voter Authorizer is 'proof-of-identity'
Expand Down
1 change: 1 addition & 0 deletions lib/av_client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ export interface OptionContent {
}
maxChooseableSuboptions?: number
minChooseableSuboptions?: number
candidateId?: number
}

export interface ParentOption {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.1.1",
"version": "4.1.2",
"name": "@aion-dk/js-client",
"license": "MIT",
"description": "Assembly Voting JS client",
Expand Down
Loading