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

fix decoding ABI params with struct type #471

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
16 changes: 10 additions & 6 deletions libs/tx-builder/src/utils/deepDecoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,17 @@
const inputsWithValues = (inputs as any[]).map((input, index) => ({
name: input.name,
type: input.type,
value: Array.isArray(result.args?.[index])
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
(result.args?.[index] as Array<any>).length
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value:
(result.args?.[index] as any).constructor === {}.constructor

Check warning on line 162 in libs/tx-builder/src/utils/deepDecoding.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
? JSON.stringify(result.args?.[index]) // struct as json object
: Array.isArray(result.args?.[index]) // array
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
(result.args?.[index] as Array<any>).toString()
: '[]'
: result.args?.[index]?.toString() || '0x',
(result.args?.[index] as Array<any>).length
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
(result.args?.[index] as Array<any>).toString()
: '[]'
: result.args?.[index]?.toString() || '0x',
}));

return {
Expand Down
Loading