(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)
}
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()
}
}

View File

@ -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()
}

View File

@ -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) {