mirror of
https://github.com/tornadocash/provider.git
synced 2024-11-22 01:36:51 +01:00
fix: update
This commit is contained in:
parent
fd15df068d
commit
d7454e14c7
@ -2,7 +2,7 @@ const Web3 = require('web3')
|
|||||||
const { hexToNumberString, toChecksumAddress, numberToHex } = require('web3-utils')
|
const { hexToNumberString, toChecksumAddress, numberToHex } = require('web3-utils')
|
||||||
|
|
||||||
export default (ctx, inject) => {
|
export default (ctx, inject) => {
|
||||||
const moduleOptions = <%= JSON.stringify(options) %>
|
// const moduleOptions = <%= JSON.stringify(options) %>
|
||||||
|
|
||||||
const instance = class Provider {
|
const instance = class Provider {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
@ -264,17 +264,21 @@ export default (ctx, inject) => {
|
|||||||
_repeatUntilResult(action, totalAttempts, retryAttempt = 1) {
|
_repeatUntilResult(action, totalAttempts, retryAttempt = 1) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const iteration = async () => {
|
const iteration = async () => {
|
||||||
const result = await action()
|
try {
|
||||||
|
const result = await action()
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
if (retryAttempt <= totalAttempts) {
|
if (retryAttempt <= totalAttempts) {
|
||||||
retryAttempt++
|
retryAttempt++
|
||||||
setTimeout(iteration, 1000 * retryAttempt)
|
setTimeout(iteration, 1000 * retryAttempt)
|
||||||
|
} else {
|
||||||
|
return reject(new Error('Tx not minted'))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return reject(new Error('Tx not minted'))
|
resolve(result)
|
||||||
}
|
}
|
||||||
} else {
|
} catch (err) {
|
||||||
resolve(result)
|
reject(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nuxtjs/provider",
|
"name": "@nuxtjs/provider",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"description": "Provider integration with Nuxt.js",
|
"description": "Provider integration with Nuxt.js",
|
||||||
"repository": "provider-module",
|
"repository": "provider-module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
Loading…
Reference in New Issue
Block a user