Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitagora-booth

Package Overview
Dependencies
Maintainers
1
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitagora-booth - npm Package Compare versions

Comparing version 1.0.146 to 1.0.147

38

lib/functions.js

@@ -371,2 +371,5 @@ /**

try {
console.log(pollPrivkey);
console.log(address);
console.log(encryptedString);
const voterPubkey = address.substr(14) + encryptedString.substr(2,10);

@@ -391,30 +394,15 @@ const encrypted = Buffer.from(encryptedString.substr(12), 'base64');

function decryptBallots(pollId, pollPrivkey) {
function decryptBallots(ballots, pollPrivkey) {
console.log("In decrypt ballots");
console.log("Poll id");
console.log(pollId);
console.log("Ballots to decrypt");
console.log(ballots);
return new Promise((resolve, reject) => {
try {
if (!Boolean(pollId)) throw('No poll id');
requestState('ballots', pollId).then((result) => {
try {
console.log("Inside decrypt ballots. Result from state");
console.log(result);
if (!Boolean(result) || (result.status != 'FOUND')) throw 'No data';
let ballots = result.ballots;
console.log("Ballots to decrypt");
console.log(ballots);
if (!Boolean(ballots) || !Boolean(ballots[0]) || ballots[0].length <= 2) throw 'No data to decrypt';
let decrypted = [];
for (var i=0; i<ballots.length; i++) {
console.log(ballots[i]);
decrypted.push(decryptBallot(pollPrivkey, ballots[i].ballot, ballots[i].vote));
}
resolve(decrypted);
} catch(e) {
reject(e);
}
}).catch((e) => {
reject(e);
});
if (!Boolean(ballots)) throw 'No data to decrypt';
let decrypted = [];
for (var i=0; i<ballots.length; i++) {
console.log(ballots[i]);
decrypted.push(decryptBallot(pollPrivkey, ballots[i].ballot, ballots[i].vote));
}
resolve(decrypted);
} catch(e) {

@@ -421,0 +409,0 @@ reject(e);

{
"name": "bitagora-booth",
"version": "1.0.146",
"version": "1.0.147",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "author": "Ignasi Ribó, 2018",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc