Skip to content

Commit

Permalink
00765 Explorer should not report "Decoding Error" when error is empty…
Browse files Browse the repository at this point in the history
… in a contract result (#766)

Signed-off-by: Eric Le Ponner <[email protected]>
  • Loading branch information
ericleponner authored Nov 23, 2023
1 parent 7c8195a commit ef3c4a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/analyzer/FunctionCallAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class FunctionCallAnalyzer {
private readonly updateErrorDescription = async() => {
const i = this.contractAnalyzer.interface.value
const error = this.error.value
if (i !== null && error !== null) {
if (i !== null && error !== null && error !== "0x") {
try {
const ed = i.parseError(error)
this.errorDescription.value = Object.preventExtensions(ed)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/utils/analyzer/FunctionCallAnalyzer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe("FunctionCallAnalyzer.spec.ts", () => {
// 5) output setup (invalid output encoding)
input.value = "0x49146bde000000000000000000000000845b706151aed537b1fd81c1ea4ea03920097abd0000000000000000000000000000000000000000000000000000000002e6ae09"
output.value = "0x000000009999999999999999999999999"
error.value = "0x"
contractId.value = "0.0.359"
await flushPromises()
expect(functionCallAnalyzer.functionHash.value).toBe("0x49146bde")
Expand All @@ -122,7 +123,7 @@ describe("FunctionCallAnalyzer.spec.ts", () => {
expect(functionCallAnalyzer.errorInputs.value).toStrictEqual([])
expect(functionCallAnalyzer.inputDecodingStatus.value).toBeNull()
expect(functionCallAnalyzer.outputDecodingStatus.value).toBe("Decoding Error (hex data is odd-length)")
expect(functionCallAnalyzer.errorDecodingStatus.value).toBeNull()
expect(functionCallAnalyzer.errorDecodingStatus.value).toBeNull() // 0x is considered as no error


// 6) unmount
Expand Down

0 comments on commit ef3c4a1

Please sign in to comment.