Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhson1085 committed Mar 17, 2020
1 parent 10cb4e3 commit 1f559b7
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ class POSVJS {

async stake ({ amount, node }) {
try {
const voteAmountBN = new BigNumber(amount).multipliedBy(10 ** 18).toString(10)
const voteAmountBN = new BigNumber(amount).multipliedBy(10 ** 18).toString(10)
const gasPrice = await this.provider.getGasPrice()

let txParams = {
value: ethers.utils.hexlify(ethers.utils.bigNumberify(voteAmountBN)),
gasPrice: ethers.utils.hexlify(ethers.utils.bigNumberify(gasPrice)),
gasLimit: ethers.utils.hexlify(2000000),
chainId: this.endpoint === 'https://rpc.tomochain.com' ? 88 : 89
}

const result = await this.contract.functions.vote(node, txParams)
return result
} catch (error) {
throw error
}
let txParams = {
value: ethers.utils.hexlify(ethers.utils.bigNumberify(voteAmountBN)),
gasPrice: ethers.utils.hexlify(ethers.utils.bigNumberify(gasPrice)),
gasLimit: ethers.utils.hexlify(2000000),
chainId: this.endpoint === 'https://rpc.tomochain.com' ? 88 : 89
}

const result = await this.contract.functions.vote(node, txParams)
return result
} catch (error) {
throw error
}
}

async unstake ({ amount, node }) {
Expand Down Expand Up @@ -127,10 +127,10 @@ class POSVJS {
try {
const gasPrice = await this.provider.getGasPrice()

let txParams = {
gasPrice: ethers.utils.hexlify(ethers.utils.bigNumberify(gasPrice)),
gasLimit: ethers.utils.hexlify(2000000),
chainId: this.endpoint === 'https://rpc.tomochain.com' ? 88 : 89
let txParams = {
gasPrice: ethers.utils.hexlify(ethers.utils.bigNumberify(gasPrice)),
gasLimit: ethers.utils.hexlify(2000000),
chainId: this.endpoint === 'https://rpc.tomochain.com' ? 88 : 89
}
const result = await this.contract.functions.withdraw(blockNumber, index, txParams)
return result
Expand All @@ -157,10 +157,10 @@ class POSVJS {
}))
const gasPrice = await this.provider.getGasPrice()

let txParams = {
gasPrice: ethers.utils.hexlify(ethers.utils.bigNumberify(gasPrice)),
gasLimit: ethers.utils.hexlify(2000000),
chainId: this.endpoint === 'https://rpc.tomochain.com' ? 88 : 89
let txParams = {
gasPrice: ethers.utils.hexlify(ethers.utils.bigNumberify(gasPrice)),
gasLimit: ethers.utils.hexlify(2000000),
chainId: this.endpoint === 'https://rpc.tomochain.com' ? 88 : 89
}

const withdraw = await Promise.all(result.map(async r => {
Expand Down

0 comments on commit 1f559b7

Please sign in to comment.