New ballot creation fix for affected key

This commit is contained in:
viktor 2017-06-16 15:18:16 +03:00
parent f6f5b09d39
commit 1d6d6fabb0
3 changed files with 10 additions and 6 deletions

View File

@ -16,14 +16,16 @@ function addBallot(api, func, ballotViewObj, address, contractAddr, cb) {
if (ballotViewObj.miningKey.indexOf("0x") > -1)
ballotViewObj.miningKey = ballotViewObj.miningKey.substr(2);
ballotViewObj.miningKey = ballotViewObj.miningKey.toLowerCase();
if (ballotViewObj.owner.indexOf("0x") > -1)
ballotViewObj.owner = ballotViewObj.owner.substr(2);
ballotViewObj.owner = ballotViewObj.owner.toLowerCase();
if (ballotViewObj.affectedKey.indexOf("0x") > -1)
ballotViewObj.affectedKey = ballotViewObj.affectedKey.substr(2);
ballotViewObj.affectedKey = ballotViewObj.affectedKey.toLowerCase();
ballotViewObj.addAction = JSON.parse(ballotViewObj.addAction);
var memoHex = "0x" + toUnifiedLengthRight(toHexString(toUTF8Array(ballotViewObj.memo)));
@ -1033,7 +1035,7 @@ $(function() {
function(txHash, err) {
if (err) {
$(".loading-container").hide();
showAlert(err, "You are already voted");
showAlert(err, "You are already voted or have no rights to vote");
return;
}

View File

@ -9,14 +9,16 @@ function addBallot(api, func, ballotViewObj, address, contractAddr, cb) {
if (ballotViewObj.miningKey.indexOf("0x") > -1)
ballotViewObj.miningKey = ballotViewObj.miningKey.substr(2);
ballotViewObj.miningKey = ballotViewObj.miningKey.toLowerCase();
if (ballotViewObj.owner.indexOf("0x") > -1)
ballotViewObj.owner = ballotViewObj.owner.substr(2);
ballotViewObj.owner = ballotViewObj.owner.toLowerCase();
if (ballotViewObj.affectedKey.indexOf("0x") > -1)
ballotViewObj.affectedKey = ballotViewObj.affectedKey.substr(2);
ballotViewObj.affectedKey = ballotViewObj.affectedKey.toLowerCase();
ballotViewObj.addAction = JSON.parse(ballotViewObj.addAction);
var memoHex = "0x" + toUnifiedLengthRight(toHexString(toUTF8Array(ballotViewObj.memo)));

View File

@ -210,7 +210,7 @@ $(function() {
function(txHash, err) {
if (err) {
$(".loading-container").hide();
showAlert(err, "You are already voted");
showAlert(err, "You are already voted or have no rights to vote");
return;
}