Skip to content

Commit

Permalink
Add candidate id to option (#296)
Browse files Browse the repository at this point in the history
* Add candidate id to option

* added generateSignatureMode method
  • Loading branch information
av-mads authored May 17, 2024
1 parent 90afc14 commit f73e5cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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

0 comments on commit f73e5cc

Please sign in to comment.