Skip to content

Commit

Permalink
fix: js tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block committed Jun 25, 2024
1 parent 8d10e3b commit 936080c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/compressed-token/src/idl/light_compressed_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,12 @@ export type LightCompressedToken = {
name: 'rootIndex';
type: 'u16';
},
{
name: 'lamports';
type: {
option: 'u64';
};
},
];
};
},
Expand Down Expand Up @@ -2249,6 +2255,12 @@ export const IDL: LightCompressedToken = {
name: 'rootIndex',
type: 'u16',
},
{
name: 'lamports',
type: {
option: 'u64',
},
},
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export function packCompressedTokenAccounts(
leafIndex: account.compressedAccount.leafIndex,
},
rootIndex: rootIndices[index],
lamports: account.compressedAccount.lamports.eq(bn(0)) ? null : account.compressedAccount.lamports,
});
},
);
Expand Down
4 changes: 4 additions & 0 deletions js/compressed-token/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export type InputTokenDataWithContext = {
* The index of the leaf in the merkle tree
*/
leafIndex: number;
/**
* Lamports in the input token account.
*/
lamports: BN | null;
};

export type CompressedTokenInstructionDataInvoke = {
Expand Down
12 changes: 12 additions & 0 deletions js/stateless.js/src/idls/light_compressed_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,12 @@ export type LightCompressedToken = {
name: 'rootIndex';
type: 'u16';
},
{
name: 'lamports';
type: {
option: 'u64';
};
},
];
};
},
Expand Down Expand Up @@ -2249,6 +2255,12 @@ export const IDL: LightCompressedToken = {
name: 'rootIndex',
type: 'u16',
},
{
name: 'lamports',
type: {
option: 'u64',
},
},
],
},
},
Expand Down
1 change: 1 addition & 0 deletions js/stateless.js/src/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export interface InputTokenDataWithContext {
delegateIndex: number | null; // Option<u8>
merkleContext: PackedMerkleContext;
rootIndex: number; // u16
lamports: BN | null;
}
export type TokenData = {
/// The mint associated with this account
Expand Down

0 comments on commit 936080c

Please sign in to comment.