From 664233571e4612eb49d04c4d104ca1cb2f8d3d6d Mon Sep 17 00:00:00 2001 From: Vadim Arasev Date: Wed, 5 Sep 2018 09:49:18 +0300 Subject: [PATCH] (Update) Put address arguments at the end of argument list of functions --- src/contracts/BallotsStorage.contract.js | 4 ++-- src/contracts/VotingToChangeKeys.contract.js | 15 ++++++++------- src/contracts/VotingToChangeProxy.contract.js | 13 +++++++------ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/contracts/BallotsStorage.contract.js b/src/contracts/BallotsStorage.contract.js index 37e759c..1b843b4 100644 --- a/src/contracts/BallotsStorage.contract.js +++ b/src/contracts/BallotsStorage.contract.js @@ -14,12 +14,12 @@ export default class BallotsStorage { this.ballotsStorageInstance = new web3_10.eth.Contract(ballotsStorageAbi, BALLOTS_STORAGE_ADDRESS) } - areKeysBallotParamsValid({ ballotType, affectedKey, affectedKeyType, miningKey }) { + areKeysBallotParamsValid({ ballotType, affectedKeyType, affectedKey, miningKey }) { if (!this.ballotsStorageInstance.methods.areKeysBallotParamsValid) { return null } return this.ballotsStorageInstance.methods - .areKeysBallotParamsValid(ballotType, affectedKey, affectedKeyType, miningKey) + .areKeysBallotParamsValid(ballotType, affectedKeyType, affectedKey, miningKey) .call() } } diff --git a/src/contracts/VotingToChangeKeys.contract.js b/src/contracts/VotingToChangeKeys.contract.js index 5d718f9..7eada82 100644 --- a/src/contracts/VotingToChangeKeys.contract.js +++ b/src/contracts/VotingToChangeKeys.contract.js @@ -20,18 +20,19 @@ export default class VotingToChangeKeys { //setters createBallot({ startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType, memo }) { - let method if (this.votingToChangeKeysInstance.methods.createBallot) { - method = this.votingToChangeKeysInstance.methods.createBallot - } else { - method = this.votingToChangeKeysInstance.methods.createVotingForKeys + return this.votingToChangeKeysInstance.methods + .createBallot(startTime, endTime, ballotType, affectedKeyType, memo, affectedKey, miningKey) + .encodeABI() } - return method(startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType, memo).encodeABI() + return this.votingToChangeKeysInstance.methods + .createVotingForKeys(startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType, memo) + .encodeABI() } - createBallotToAddNewValidator({ startTime, endTime, affectedKey, newVotingKey, newPayoutKey, memo }) { + createBallotToAddNewValidator({ startTime, endTime, memo, affectedKey, newVotingKey, newPayoutKey }) { return this.votingToChangeKeysInstance.methods - .createBallotToAddNewValidator(startTime, endTime, affectedKey, newVotingKey, newPayoutKey, memo) + .createBallotToAddNewValidator(startTime, endTime, memo, affectedKey, newVotingKey, newPayoutKey) .encodeABI() } diff --git a/src/contracts/VotingToChangeProxy.contract.js b/src/contracts/VotingToChangeProxy.contract.js index c6806bb..08a0bae 100644 --- a/src/contracts/VotingToChangeProxy.contract.js +++ b/src/contracts/VotingToChangeProxy.contract.js @@ -20,13 +20,14 @@ export default class VotingToChangeProxy { //setters createBallot({ startTime, endTime, proposedValue, contractType, memo }) { - let method - if (this.votingToChangeProxyInstance.methods.createBallot) { - method = this.votingToChangeProxyInstance.methods.createBallot - } else { - method = this.votingToChangeProxyInstance.methods.createBallotToChangeProxyAddress + if (!this.votingToChangeProxyInstance.methods.createBallot) { + return this.votingToChangeProxyInstance.methods + .createBallotToChangeProxyAddress(startTime, endTime, proposedValue, contractType, memo) + .encodeABI() } - return method(startTime, endTime, proposedValue, contractType, memo).encodeABI() + return this.votingToChangeProxyInstance.methods + .createBallot(startTime, endTime, contractType, memo, proposedValue) + .encodeABI() } vote(_id, choice) {