(Refactor) Replace `let` with `const` *.contract.js files

This commit is contained in:
Vadim Arasev 2018-08-10 11:13:28 +03:00
parent 2c1a133200
commit b6e62529fb
8 changed files with 16 additions and 16 deletions

View File

@ -6,10 +6,10 @@ export default class BallotsStorage {
async init({ web3, netId }) {
const { BALLOTS_STORAGE_ADDRESS } = networkAddresses(netId)
console.log('Ballots Storage address', BALLOTS_STORAGE_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let ballotsStorageAbi = await helpers.getABI(branch, 'BallotStorage')
const ballotsStorageAbi = await helpers.getABI(branch, 'BallotStorage')
this.ballotsStorageInstance = new web3_10.eth.Contract(ballotsStorageAbi, BALLOTS_STORAGE_ADDRESS)
}

View File

@ -6,11 +6,11 @@ export default class KeysManager {
async init({ web3, netId }) {
const { KEYS_MANAGER_ADDRESS } = networkAddresses(netId)
console.log('KeysManager address', KEYS_MANAGER_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let keysManagerABI = await helpers.getABI(branch, 'KeysManager')
const keysManagerABI = await helpers.getABI(branch, 'KeysManager')
this.instance = new web3_10.eth.Contract(keysManagerABI, KEYS_MANAGER_ADDRESS)
this.address = KEYS_MANAGER_ADDRESS

View File

@ -6,11 +6,11 @@ export default class POAConsensus {
async init({ web3, netId }) {
const { POA_ADDRESS } = networkAddresses(netId)
console.log('POA address', POA_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let poaConsensusAbi = await helpers.getABI(branch, 'PoaNetworkConsensus')
const poaConsensusAbi = await helpers.getABI(branch, 'PoaNetworkConsensus')
this.poaInstance = new web3_10.eth.Contract(poaConsensusAbi, POA_ADDRESS)
}

View File

@ -6,10 +6,10 @@ export default class ProxyStorage {
async init({ web3, netId }) {
const { PROXY_ADDRESS } = networkAddresses(netId)
console.log('Proxy Storage address', PROXY_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let proxyStorageAbi = await helpers.getABI(branch, 'ProxyStorage')
const proxyStorageAbi = await helpers.getABI(branch, 'ProxyStorage')
this.proxyStorageInstance = new web3_10.eth.Contract(proxyStorageAbi, PROXY_ADDRESS)
}

View File

@ -7,11 +7,11 @@ export default class ValidatorMetadata {
async init({ web3, netId }) {
const { METADATA_ADDRESS } = networkAddresses(netId)
console.log('Metadata address', METADATA_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let MetadataAbi = await helpers.getABI(branch, 'ValidatorMetadata')
const MetadataAbi = await helpers.getABI(branch, 'ValidatorMetadata')
this.metadataInstance = new web3_10.eth.Contract(MetadataAbi, METADATA_ADDRESS)
}

View File

@ -6,11 +6,11 @@ export default class VotingToChangeKeys {
async init({ web3, netId }) {
const { VOTING_TO_CHANGE_KEYS_ADDRESS } = networkAddresses(netId)
console.log('VotingToChangeKeys address', VOTING_TO_CHANGE_KEYS_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let votingToChangeKeysABI = await helpers.getABI(branch, 'VotingToChangeKeys')
const votingToChangeKeysABI = await helpers.getABI(branch, 'VotingToChangeKeys')
this.votingToChangeKeysInstance = new web3_10.eth.Contract(votingToChangeKeysABI, VOTING_TO_CHANGE_KEYS_ADDRESS)
this.gasPrice = web3_10.utils.toWei('1', 'gwei')

View File

@ -6,11 +6,11 @@ export default class VotingToChangeMinThreshold {
async init({ web3, netId }) {
const { VOTING_TO_CHANGE_MIN_THRESHOLD_ADDRESS } = networkAddresses(netId)
console.log('VotingToChangeMinThreshold address', VOTING_TO_CHANGE_MIN_THRESHOLD_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let votingToChangeMinThresholdABI = await helpers.getABI(branch, 'VotingToChangeMinThreshold')
const votingToChangeMinThresholdABI = await helpers.getABI(branch, 'VotingToChangeMinThreshold')
this.votingToChangeMinThresholdInstance = new web3_10.eth.Contract(
votingToChangeMinThresholdABI,

View File

@ -6,11 +6,11 @@ export default class VotingToChangeProxy {
async init({ web3, netId }) {
const { VOTING_TO_CHANGE_PROXY_ADDRESS } = networkAddresses(netId)
console.log('VotingToChangeProxy address', VOTING_TO_CHANGE_PROXY_ADDRESS)
let web3_10 = new Web3(web3.currentProvider)
const web3_10 = new Web3(web3.currentProvider)
const branch = helpers.getBranch(netId)
let votingToChangeProxyABI = await helpers.getABI(branch, 'VotingToChangeProxyAddress')
const votingToChangeProxyABI = await helpers.getABI(branch, 'VotingToChangeProxyAddress')
this.votingToChangeProxyInstance = new web3_10.eth.Contract(votingToChangeProxyABI, VOTING_TO_CHANGE_PROXY_ADDRESS)
this.gasPrice = web3_10.utils.toWei('1', 'gwei')