Merge pull request #172 from varasev/address-arguments
(Refactor) Put address arguments at the end of argument list of functions
This commit is contained in:
commit
12719ebd8c
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue