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
b3162c8d
Commit
b3162c8d
authored
Jun 29, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comment
parent
59e7788f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
txExecution.ts
libs/remix-lib/src/execution/txExecution.ts
+6
-2
No files found.
libs/remix-lib/src/execution/txExecution.ts
View file @
b3162c8d
...
...
@@ -105,20 +105,24 @@ export function checkVMError (execResult, abi, contract) {
if
(
returnDataHex
===
sign
.
replace
(
'0x'
,
''
))
{
customError
=
item
.
name
const
functionDesc
=
fn
.
getFunction
(
item
.
name
)
// decoding error parameters
const
decodedCustomErrorInputs
=
fn
.
decodeFunctionData
(
functionDesc
,
returnData
)
decodedCustomErrorInputsClean
=
{}
let
devdoc
=
{}
// "contract" reprensents the compilation result containing the NATSPEC documentation
if
(
contract
&&
fn
.
functions
&&
Object
.
keys
(
fn
.
functions
).
length
)
{
const
functionSignature
=
Object
.
keys
(
fn
.
functions
)[
0
]
// we check in the 'devdoc' if there's a developer documentation for this error
devdoc
=
contract
.
object
.
devdoc
.
errors
[
functionSignature
][
0
]
||
{}
// we check in the 'userdoc' if there's an user documentation for this error
const
userdoc
=
contract
.
object
.
userdoc
.
errors
[
functionSignature
][
0
]
||
{}
if
(
userdoc
)
customError
+=
' : '
+
(
userdoc
as
any
).
notice
if
(
userdoc
)
customError
+=
' : '
+
(
userdoc
as
any
).
notice
// we append the user doc if any
}
for
(
const
input
of
functionDesc
.
inputs
)
{
const
v
=
decodedCustomErrorInputs
[
input
.
name
]
decodedCustomErrorInputsClean
[
input
.
name
]
=
{
value
:
v
.
toString
?
v
.
toString
()
:
v
,
documentation
:
(
devdoc
as
any
).
params
[
input
.
name
]
documentation
:
(
devdoc
as
any
).
params
[
input
.
name
]
// we add the developer documentation for this input parameter if any
}
}
break
...
...
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