Skip to content

Commit

Permalink
fix: Don't return offset from public decode functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed May 23, 2024
1 parent 395eb2c commit 99aa766
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/abi-coder/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class Interface<TAbi extends JsonAbi = JsonAbi> {
const fragment =
typeof functionFragment === 'string' ? this.getFunction(functionFragment) : functionFragment;

return fragment.decodeOutput(data);
return fragment.decodeOutput(data)[0];
}

decodeLog(data: BytesLike, logId: string): any {
Expand All @@ -85,7 +85,7 @@ export class Interface<TAbi extends JsonAbi = JsonAbi> {

return AbiCoder.decode(this.jsonAbi, loggedType.loggedType, arrayify(data), 0, {
encoding: this.encoding,
});
})[0];
}

encodeConfigurable(name: string, value: InputValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function getDecodedLogs<T = unknown>(
? new BigNumberCoder('u64').encode(receipt.val0)
: receipt.data;

const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toString());
const decodedLog = interfaceToUse.decodeLog(data, receipt.val1.toString());
logs.push(decodedLog);
}

Expand Down

0 comments on commit 99aa766

Please sign in to comment.