Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
072c5763
Commit
072c5763
authored
May 19, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove promise
parent
23c8cd0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
txRunnerWeb3.ts
libs/remix-lib/src/execution/txRunnerWeb3.ts
+11
-20
No files found.
libs/remix-lib/src/execution/txRunnerWeb3.ts
View file @
072c5763
...
@@ -128,29 +128,20 @@ export class TxRunnerWeb3 {
...
@@ -128,29 +128,20 @@ export class TxRunnerWeb3 {
}
}
async
function
tryTillReceiptAvailable
(
txhash
,
web3
)
{
async
function
tryTillReceiptAvailable
(
txhash
,
web3
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
web3
.
eth
.
getTransactionReceipt
(
txhash
,
async
(
err
,
receipt
)
=>
{
const
receipt
=
await
web3
.
eth
.
getTransactionReceipt
(
txhash
)
if
(
err
||
!
receipt
)
{
if
(
receipt
)
return
receipt
// Try again with a bit of delay if error or if result still null
}
catch
(
e
)
{}
await
pause
()
await
pause
()
return
resolve
(
await
tryTillReceiptAvailable
(
txhash
,
web3
))
return
await
tryTillReceiptAvailable
(
txhash
,
web3
)
}
return
resolve
(
receipt
)
})
})
}
}
async
function
tryTillTxAvailable
(
txhash
,
web3
)
{
async
function
tryTillTxAvailable
(
txhash
,
web3
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
web3
.
eth
.
getTransaction
(
txhash
,
async
(
err
,
tx
)
=>
{
const
tx
=
await
web3
.
eth
.
getTransaction
(
txhash
)
if
(
err
||
!
tx
)
{
if
(
tx
)
return
tx
// Try again with a bit of delay if error or if result still null
}
catch
(
e
)
{}
await
pause
()
return
await
tryTillTxAvailable
(
txhash
,
web3
)
return
resolve
(
await
tryTillTxAvailable
(
txhash
,
web3
))
}
return
resolve
(
tx
)
})
})
}
}
async
function
pause
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(
resolve
,
500
)
})
}
async
function
pause
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(
resolve
,
500
)
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment