Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

00765 Explorer should not report "Decoding Error" when error is empty in a contract result #766

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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