(Update) Put address arguments at the end of argument list of functions

This commit is contained in:
Vadim Arasev 2018-09-05 09:49:18 +03:00
parent 321fda4880
commit 664233571e
3 changed files with 17 additions and 15 deletions

View File

@ -14,12 +14,12 @@ export default class BallotsStorage {
this.ballotsStorageInstance = new web3_10.eth.Contract(ballotsStorageAbi, BALLOTS_STORAGE_ADDRESS) 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) { if (!this.ballotsStorageInstance.methods.areKeysBallotParamsValid) {
return null return null
} }
return this.ballotsStorageInstance.methods return this.ballotsStorageInstance.methods
.areKeysBallotParamsValid(ballotType, affectedKey, affectedKeyType, miningKey) .areKeysBallotParamsValid(ballotType, affectedKeyType, affectedKey, miningKey)
.call() .call()
} }
} }

View File

@ -20,18 +20,19 @@ export default class VotingToChangeKeys {
//setters //setters
createBallot({ startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType, memo }) { createBallot({ startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType, memo }) {
let method
if (this.votingToChangeKeysInstance.methods.createBallot) { if (this.votingToChangeKeysInstance.methods.createBallot) {
method = this.votingToChangeKeysInstance.methods.createBallot return this.votingToChangeKeysInstance.methods
} else { .createBallot(startTime, endTime, ballotType, affectedKeyType, memo, affectedKey, miningKey)
method = this.votingToChangeKeysInstance.methods.createVotingForKeys .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 return this.votingToChangeKeysInstance.methods
.createBallotToAddNewValidator(startTime, endTime, affectedKey, newVotingKey, newPayoutKey, memo) .createBallotToAddNewValidator(startTime, endTime, memo, affectedKey, newVotingKey, newPayoutKey)
.encodeABI() .encodeABI()
} }

View File

@ -20,13 +20,14 @@ export default class VotingToChangeProxy {
//setters //setters
createBallot({ startTime, endTime, proposedValue, contractType, memo }) { createBallot({ startTime, endTime, proposedValue, contractType, memo }) {
let method if (!this.votingToChangeProxyInstance.methods.createBallot) {
if (this.votingToChangeProxyInstance.methods.createBallot) { return this.votingToChangeProxyInstance.methods
method = this.votingToChangeProxyInstance.methods.createBallot .createBallotToChangeProxyAddress(startTime, endTime, proposedValue, contractType, memo)
} else { .encodeABI()
method = this.votingToChangeProxyInstance.methods.createBallotToChangeProxyAddress
} }
return method(startTime, endTime, proposedValue, contractType, memo).encodeABI() return this.votingToChangeProxyInstance.methods
.createBallot(startTime, endTime, contractType, memo, proposedValue)
.encodeABI()
} }
vote(_id, choice) { vote(_id, choice) {