Skip to content

Commit 34cf770

Browse files
committed
Rename BallotProof to DavinciCrypto and add build step to preinstall
- Rename BallotProof class and BallotProofInputs type to DavinciCrypto and DavinciCryptoInputs - Update preinstall script to run yarn build before packing SDK - Update imports and usage across VotingScreen and ProcessDetailClient components
1 parent 8b650a3 commit 34cf770

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

examples/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"preinstall": "cd ../.. && yarn pack && mv vocdoni-davinci-sdk-v*.tgz examples/ui/davinci-sdk.tgz",
7+
"preinstall": "cd ../.. && yarn build && yarn pack && mv vocdoni-davinci-sdk-v*.tgz examples/ui/davinci-sdk.tgz",
88
"dev": "vite",
99
"build": "vite build",
1010
"lint": "eslint .",

examples/ui/src/components/VotingScreen.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import {
2727
Typography,
2828
} from '@mui/material'
2929
import {
30-
BallotProof,
30+
DavinciCrypto,
3131
CircomProof,
3232
VocdoniApiService,
33-
type BallotProofInputs,
33+
type DavinciCryptoInputs,
3434
type InfoResponse,
3535
type IQuestion,
3636
type MultiLanguage,
@@ -225,7 +225,7 @@ export default function VotingScreen({ onBack, onNext }: VotingScreenProps) {
225225
// Get WASM URLs from API info
226226
const info = await api.sequencer.getInfo()
227227
const urls = getCircuitUrls(info)
228-
const sdk = new BallotProof({
228+
const sdk = new DavinciCrypto({
229229
wasmExecUrl: urls.ballotProofExec,
230230
wasmUrl: urls.ballotProof,
231231
})
@@ -251,7 +251,7 @@ export default function VotingScreen({ onBack, onNext }: VotingScreenProps) {
251251
// Flatten all arrays into one, preserving order
252252
const fieldValues = questionArrays.flat()
253253

254-
const inputs: BallotProofInputs = {
254+
const inputs: DavinciCryptoInputs = {
255255
address: selectedAddress,
256256
processID: details.processId,
257257
ballotMode: {

examples/ui/src/pages/process-detail/ProcessDetailClient.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import {
3434
createTheme,
3535
} from '@mui/material'
3636
import {
37-
BallotProof,
38-
type BallotProofInputs,
37+
DavinciCrypto,
38+
type DavinciCryptoInputs,
3939
CircomProof,
4040
type GetProcessResponse,
4141
type InfoResponse,
@@ -634,7 +634,7 @@ export default function ProcessDetailClient() {
634634
// Get WASM URLs from API info
635635
const info = await api.sequencer.getInfo()
636636
const urls = getCircuitUrls(info)
637-
const sdk = new BallotProof({
637+
const sdk = new DavinciCrypto({
638638
wasmExecUrl: urls.ballotProofExec,
639639
wasmUrl: urls.ballotProof,
640640
})
@@ -660,7 +660,7 @@ export default function ProcessDetailClient() {
660660
// Flatten all arrays into one, preserving order
661661
const fieldValues = questionArrays.flat()
662662

663-
const inputs: BallotProofInputs = {
663+
const inputs: DavinciCryptoInputs = {
664664
address: walletAddress.replace(/^0x/, ''),
665665
processID: processData.id.replace(/^0x/, ''),
666666
encryptionKey: [processData.encryptionKey.x, processData.encryptionKey.y],

0 commit comments

Comments
 (0)