Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 3f67531

Browse files
authored
lending/js: fix unintentional recursion (#2018)
* bind to layout * version bump: 0.3.4
1 parent 73e4e0c commit 3f67531

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

token-lending/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solana/spl-token-lending",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "SPL Token Lending JavaScript API",
55
"license": "MIT",
66
"author": "Solana Maintainers <[email protected]>",

token-lending/js/src/util/layout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export interface EncodeDecode<T> {
2323

2424
/** @internal */
2525
export const encodeDecode = <T>(layout: Layout<T>): EncodeDecode<T> => {
26-
const decode = (buffer: Buffer, offset?: number) => layout.decode(buffer, offset);
27-
const encode = (src: T, buffer: Buffer, offset?: number) => layout.encode(src, buffer, offset);
26+
const decode = layout.decode.bind(layout);
27+
const encode = layout.encode.bind(layout);
2828
return { decode, encode };
2929
};
3030

0 commit comments

Comments
 (0)