mirror of
https://github.com/status-im/nim-ethers.git
synced 2025-01-27 07:35:17 +00:00
Remove unnecessary error check
This commit is contained in:
parent
7d2acd65e8
commit
e8592bb922
@ -1,23 +1,19 @@
|
||||
import std/strutils
|
||||
import std/json
|
||||
import ./provider
|
||||
|
||||
proc revertReason*(e: ref ProviderError): string =
|
||||
try:
|
||||
var msg = e.msg
|
||||
const revertPrefixes = @[
|
||||
# hardhat
|
||||
"Error: VM Exception while processing transaction: reverted with " &
|
||||
"reason string ",
|
||||
# ganache
|
||||
"VM Exception while processing transaction: revert "
|
||||
]
|
||||
for prefix in revertPrefixes.items:
|
||||
msg = msg.replace(prefix)
|
||||
msg = msg.replace("\'")
|
||||
return msg
|
||||
except JsonParsingError:
|
||||
return ""
|
||||
var msg = e.msg
|
||||
const revertPrefixes = @[
|
||||
# hardhat
|
||||
"Error: VM Exception while processing transaction: reverted with " &
|
||||
"reason string ",
|
||||
# ganache
|
||||
"VM Exception while processing transaction: revert "
|
||||
]
|
||||
for prefix in revertPrefixes.items:
|
||||
msg = msg.replace(prefix)
|
||||
msg = msg.replace("\'")
|
||||
return msg
|
||||
|
||||
proc reverts*[T](call: Future[T]): Future[bool] {.async.} =
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user