Skip to content

Commit b1a0dd0

Browse files
author
Julien
committed
Add gasPrice and gasLimit to proxyNew()
1 parent 71611d6 commit b1a0dd0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/infura/proxy.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ export default class Proxy {
5353
* Create a new DSProxy for the given user.
5454
* Later can query proxies by getUserProxy in this class.
5555
* @param {address} user User of the system - a CFD party
56+
* @param {Number} gasLimit How much gas we are willing to spent
57+
* @param {Number} gasPrice Price of the gas
58+
(if undefined, will use the default value from config file)
5659
*/
57-
async proxyNew(user) {
60+
async proxyNew(user, gasLimit = 1000000, gasPrice = undefined) {
5861
// Function to wait
5962
const timeout = async ms => {
6063
return new Promise(resolve => setTimeout(resolve, ms))
@@ -63,7 +66,8 @@ export default class Proxy {
6366
// Tx1: create proxy contract
6467
const buildTx = await this.dsProxyFactory.methods.build(user).send({
6568
from: user,
66-
gas: 1000000
69+
gas: gasLimit,
70+
gasPrice: gasPrice || this.config.gasPrice,
6771
})
6872
logGas(`Proxy build`, buildTx)
6973

0 commit comments

Comments
 (0)