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(cli): Fix parse error on undefined values in tuples #1285

Merged
merged 8 commits into from
Aug 20, 2024
Merged
Changes from 5 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
6 changes: 2 additions & 4 deletions packages/cli/src/commands/decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export async function decode({
renderArgs(
{
...components[i],
name: `[${i}]`,
name: `${components[i].name}`,
},
v[i],
v[`${components[i].name}`] ? v[`${components[i].name}`] : v[i],
offset.repeat(2)
);
}
Expand Down Expand Up @@ -149,7 +149,6 @@ function _renderValue(type: viem.AbiParameter, value: string | bigint) {

case type.type === 'address':
return viem.getAddress(value);

case type.type == 'bool':
return typeof value == 'string' && value.startsWith('0x') ? viem.hexToBool(value as viem.Hex) : value;

Expand Down Expand Up @@ -183,7 +182,6 @@ function _parseData(abis: ContractData['abi'][], data: viem.Hash[]) {
data: data.length > 1 ? data[data.length - 1] : '0x',
})
);

if (result) return { abi, result };
}

Expand Down
Loading