Skip to content

Commit b23b09d

Browse files
author
Eric Jiang
committed
chore(): fix lint
1 parent a28fdc5 commit b23b09d

File tree

7 files changed

+119
-26
lines changed

7 files changed

+119
-26
lines changed

factory.js

+12-10
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,14 @@ async function _sendTx(acct, label, version, bytecode, data, upgrade = false, ga
367367
const { contract: registry, ctx: ctx2 } = await contract.get(registryAbi, constants.ARA_REGISTRY_ADDRESS)
368368
if (!upgrade) {
369369
address = await new Promise((resolve, reject) => {
370-
tx.sendSignedTransaction(transaction,
370+
tx.sendSignedTransaction(
371+
transaction,
371372
{
372-
onhash: (hash) => debug('onhash:', hash),
373-
onreceipt: (receipt) => debug('onreceipt:', receipt),
373+
onhash: hash => debug('onhash:', hash),
374+
onreceipt: receipt => debug('onreceipt:', receipt),
374375
onconfirmation: (confNumber, receipt) => debug('onconfirmation:', confNumber, receipt),
375-
onerror: (error) => debug('onerror:', error),
376-
onmined: (receipt) => debug('onmined:', receipt)
376+
onerror: error => debug('onerror:', error),
377+
onmined: receipt => debug('onmined:', receipt)
377378
}
378379
)
379380
registry.events.UpgradeableContractAdded({ fromBlock: 'latest' })
@@ -397,13 +398,14 @@ async function _sendTx(acct, label, version, bytecode, data, upgrade = false, ga
397398
})
398399
} else {
399400
await new Promise((resolve, reject) => {
400-
tx.sendSignedTransaction(transaction,
401+
tx.sendSignedTransaction(
402+
transaction,
401403
{
402-
onhash: (hash) => debug('onhash:', hash),
403-
onreceipt: (receipt) => debug('onreceipt:', receipt),
404+
onhash: hash => debug('onhash:', hash),
405+
onreceipt: receipt => debug('onreceipt:', receipt),
404406
onconfirmation: (confNumber, receipt) => debug('onconfirmation:', confNumber, receipt),
405-
onerror: (error) => debug('onerror:', error),
406-
onmined: (receipt) => debug('onmined:', receipt)
407+
onerror: error => debug('onerror:', error),
408+
onmined: receipt => debug('onmined:', receipt)
407409
}
408410
)
409411
registry.events.ContractUpgraded()

ownership.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,13 @@ async function approveOwnershipTransfer(opts) {
235235
return cost
236236
}
237237

238-
const receipt = await tx.sendSignedTransaction(approveTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
238+
const receipt = await tx.sendSignedTransaction(approveTx, {
239+
onhash,
240+
onreceipt,
241+
onconfirmation,
242+
onerror,
243+
onmined
244+
})
239245
ctx.close()
240246
return receipt
241247
}
@@ -309,7 +315,13 @@ async function _updateOwnershipRequest(opts, functionName = '') {
309315
return cost
310316
}
311317

312-
const receipt = await tx.sendSignedTransaction(requestTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
318+
const receipt = await tx.sendSignedTransaction(requestTx, {
319+
onhash,
320+
onreceipt,
321+
onconfirmation,
322+
onerror,
323+
onmined
324+
})
313325
ctx.close()
314326
return receipt
315327
}

purchase.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ async function purchase(opts) {
164164
return String(Number(cost) + Number(load || 0))
165165
}
166166

167-
receipt = await tx.sendSignedTransaction(purchaseTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
167+
receipt = await tx.sendSignedTransaction(purchaseTx, {
168+
onhash,
169+
onreceipt,
170+
onconfirmation,
171+
onerror,
172+
onmined
173+
})
168174
ctx.close()
169175
if (receipt.status) {
170176
// 211296 gas

registry.js

+21-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,13 @@ async function upgradeProxy(opts) {
183183

184184
const { contract: registry, ctx: ctx2 } = await contract.get(abi, constants.REGISTRY_ADDRESS)
185185
upgraded = await new Promise((resolve, reject) => {
186-
tx.sendSignedTransaction(transaction, { onhash, onreceipt, onconfirmation, onerror, onmined })
186+
tx.sendSignedTransaction(transaction, {
187+
onhash,
188+
onreceipt,
189+
onconfirmation,
190+
onerror,
191+
onmined
192+
})
187193
// listen to ProxyUpgraded event for proxy address
188194
registry.events.ProxyUpgraded({ fromBlock: 'latest' })
189195
.on('data', (log) => {
@@ -333,7 +339,13 @@ async function deployProxy(opts) {
333339

334340
const { contract: registry, ctx: ctx2 } = await contract.get(abi, constants.REGISTRY_ADDRESS)
335341
proxyAddress = await new Promise((resolve, reject) => {
336-
tx.sendSignedTransaction(transaction, { onhash, onreceipt, onconfirmation, onerror, onmined })
342+
tx.sendSignedTransaction(transaction, {
343+
onhash,
344+
onreceipt,
345+
onconfirmation,
346+
onerror,
347+
onmined
348+
})
337349
// listen to ProxyDeployed event for proxy address
338350
registry.events.ProxyDeployed({ fromBlock: 'latest' })
339351
.on('data', (log) => {
@@ -566,7 +578,13 @@ async function deployNewStandard(opts) {
566578
// listen to ProxyDeployed event for proxy address
567579
const { contract: registry, ctx: ctx2 } = await contract.get(abi, constants.REGISTRY_ADDRESS)
568580
address = await new Promise((resolve, reject) => {
569-
tx.sendSignedTransaction(transaction, { onhash, onreceipt, onconfirmation, onerror, onmined })
581+
tx.sendSignedTransaction(transaction, {
582+
onhash,
583+
onreceipt,
584+
onconfirmation,
585+
onerror,
586+
onmined
587+
})
570588
registry.events.StandardAdded({ fromBlock: 'latest' })
571589
.on('data', (log) => {
572590
const { returnValues: { _version, _address } } = log

rewards.js

+16-3
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ async function submit(opts) {
180180
submitTx,
181181
{
182182
onhash,
183-
onreceipt: r => {
183+
onreceipt: (r) => {
184+
if ('function' === typeof onreceipt) onreceipt(r)
184185
resolve(r)
185186
},
186187
onconfirmation,
@@ -357,7 +358,13 @@ async function allocate(opts) {
357358
return cost
358359
}
359360

360-
const receipt = await tx.sendSignedTransaction(allocateTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
361+
const receipt = await tx.sendSignedTransaction(allocateTx, {
362+
onhash,
363+
onreceipt,
364+
onconfirmation,
365+
onerror,
366+
onmined
367+
})
361368
ctx1.close()
362369
if (receipt.status) {
363370
debug('gas used', receipt.gasUsed)
@@ -458,7 +465,13 @@ async function redeem(opts) {
458465
const { contract: tokenContract, ctx: ctx3 } = await contract.get(tokenAbi, ARA_TOKEN_ADDRESS)
459466
balance = await new Promise((resolve, reject) => {
460467
const { web3 } = ctx3
461-
tx.sendSignedTransaction(redeemTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
468+
tx.sendSignedTransaction(redeemTx, {
469+
onhash,
470+
onreceipt,
471+
onconfirmation,
472+
onerror,
473+
onmined
474+
})
462475
tokenContract.events.Transfer({ fromBlock: 'latest' })
463476
.on('data', (log) => {
464477
const { returnValues: { from, to, value } } = log

storage.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ async function write(opts, estimate = true, append = false) {
7575
return cost
7676
}
7777

78-
const receipt = await tx.sendSignedTransaction(transaction, { onhash, onreceipt, onconfirmation, onerror, onmined })
78+
const receipt = await tx.sendSignedTransaction(transaction, {
79+
onhash,
80+
onreceipt,
81+
onconfirmation,
82+
onerror,
83+
onmined
84+
})
7985
ctx.close()
8086
return receipt
8187
}

token.js

+42-6
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,13 @@ async function transfer(opts = {}) {
174174
values: [ to, val ]
175175
}
176176
})
177-
receipt = await tx.sendSignedTransaction(transferTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
177+
receipt = await tx.sendSignedTransaction(transferTx, {
178+
onhash,
179+
onreceipt,
180+
onconfirmation,
181+
onerror,
182+
onmined
183+
})
178184
ctx.close()
179185
} catch (err) {
180186
throw err
@@ -240,7 +246,13 @@ async function approve(opts = {}) {
240246
values: [ spender, val ]
241247
}
242248
})
243-
receipt = await tx.sendSignedTransaction(approveTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
249+
receipt = await tx.sendSignedTransaction(approveTx, {
250+
onhash,
251+
onreceipt,
252+
onconfirmation,
253+
onerror,
254+
onmined
255+
})
244256
ctx.close()
245257
} catch (err) {
246258
throw err
@@ -325,7 +337,13 @@ async function transferFrom(opts = {}) {
325337
values: [ from, to, val ]
326338
}
327339
})
328-
receipt = await tx.sendSignedTransaction(transferFromTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
340+
receipt = await tx.sendSignedTransaction(transferFromTx, {
341+
onhash,
342+
onreceipt,
343+
onconfirmation,
344+
onerror,
345+
onmined
346+
})
329347
ctx.close()
330348
} catch (err) {
331349
throw err
@@ -400,7 +418,13 @@ async function increaseApproval(opts = {}) {
400418
return cost
401419
}
402420

403-
receipt = await tx.sendSignedTransaction(increaseApprovalTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
421+
receipt = await tx.sendSignedTransaction(increaseApprovalTx, {
422+
onhash,
423+
onreceipt,
424+
onconfirmation,
425+
onerror,
426+
onmined
427+
})
404428
ctx.close()
405429
} catch (err) {
406430
throw err
@@ -467,7 +491,13 @@ async function decreaseApproval(opts = {}) {
467491
values: [ spender, val ]
468492
}
469493
})
470-
receipt = await tx.sendSignedTransaction(decreaseApprovalTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
494+
receipt = await tx.sendSignedTransaction(decreaseApprovalTx, {
495+
onhash,
496+
onreceipt,
497+
onconfirmation,
498+
onerror,
499+
onmined
500+
})
471501
ctx.close()
472502
} catch (err) {
473503
throw err
@@ -589,7 +619,13 @@ async function modifyDeposit(opts = {}) {
589619
values: [ val ]
590620
}
591621
})
592-
receipt = await tx.sendSignedTransaction(depositTx, { onhash, onreceipt, onconfirmation, onerror, onmined })
622+
receipt = await tx.sendSignedTransaction(depositTx, {
623+
onhash,
624+
onreceipt,
625+
onconfirmation,
626+
onerror,
627+
onmined
628+
})
593629
ctx.close()
594630
if (receipt.status) {
595631
debug(wd ? 'withdrew' : 'deposited', constrainTokenValue(val), 'tokens')

0 commit comments

Comments
 (0)