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)
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue