(Fix) Display alert "Invalid voting key" for Confirm and Finalize btns
Related to https://github.com/poanetwork/poa-dapps-validators/issues/72
This commit is contained in:
parent
3d52c78bf3
commit
d3026e7c0c
|
@ -179,6 +179,10 @@ export default class Metadata {
|
||||||
message: `You cannot confirm your own changes.\n
|
message: `You cannot confirm your own changes.\n
|
||||||
Please ask other validators to verify your new information.`
|
Please ask other validators to verify your new information.`
|
||||||
}
|
}
|
||||||
|
} else if (senderMiningKey === '0x0000000000000000000000000000000000000000') {
|
||||||
|
throw {
|
||||||
|
message: messages.invalidaVotingKey
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return await this.metadataInstance.methods
|
return await this.metadataInstance.methods
|
||||||
.confirmPendingChange(miningKeyToConfirm)
|
.confirmPendingChange(miningKeyToConfirm)
|
||||||
|
@ -194,13 +198,18 @@ export default class Metadata {
|
||||||
return validatorData.minThreshold
|
return validatorData.minThreshold
|
||||||
}
|
}
|
||||||
|
|
||||||
async finalize({ miningKeyToConfirm, senderVotingKey }) {
|
async finalize({ miningKeyToConfirm, senderVotingKey, senderMiningKey }) {
|
||||||
const confirmations = await this.getConfirmations({
|
const confirmations = await this.getConfirmations({
|
||||||
miningKey: miningKeyToConfirm
|
miningKey: miningKeyToConfirm
|
||||||
})
|
})
|
||||||
const getMinThreshold = await this.getMinThreshold({
|
const getMinThreshold = await this.getMinThreshold({
|
||||||
miningKey: miningKeyToConfirm
|
miningKey: miningKeyToConfirm
|
||||||
})
|
})
|
||||||
|
if (senderMiningKey === '0x0000000000000000000000000000000000000000') {
|
||||||
|
throw {
|
||||||
|
message: messages.invalidaVotingKey
|
||||||
|
}
|
||||||
|
}
|
||||||
if (Number(confirmations[0]) < Number(getMinThreshold)) {
|
if (Number(confirmations[0]) < Number(getMinThreshold)) {
|
||||||
throw {
|
throw {
|
||||||
message: `There is not enough confimations.\n
|
message: `There is not enough confimations.\n
|
||||||
|
|
Loading…
Reference in New Issue