Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ece committed Oct 3, 2024
1 parent f51ee51 commit 5ed20d2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions anchor/src/client/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ export class BaseClient {
treasuryId: fundAccount.treasury.toBase58(),
openfundsMetadataId: fundAccount.openfunds.toBase58(),
fundUri: `https://playground.glam.systems/products/${fundPDA}`,
//@ts-ignore
imageKey: (fundModel.shareClasses[0]?.id || fundPDA).toBase58(),
...this.getOpenfundsFromAccounts(fundAccount, openfundsAccount, [
firstShareClass,
Expand Down
2 changes: 2 additions & 0 deletions anchor/src/client/drift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export class DriftClient {
const state = await getDriftStateAccountPublicKey(this.DRIFT_PROGRAM);

const tx = await this.base.program.methods
//@ts-ignore
.driftPlaceOrders(orderParams)
.accounts({
fund,
Expand Down Expand Up @@ -402,6 +403,7 @@ export class DriftClient {
const state = await getDriftStateAccountPublicKey(this.DRIFT_PROGRAM);

const tx = await this.base.program.methods
//@ts-ignore
.driftCancelOrders(marketType, marketIndex, direction)
.accounts({
fund,
Expand Down
2 changes: 1 addition & 1 deletion anchor/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const FundModel = class<FundModel> {
: null,
manager: obj.fundManagers
? (new ManagerModel(obj.fundManagers[0]) as ManagerModel)
: null,
: obj?.manager || null,
rawOpenfunds: new FundOpenfundsModel(obj) as FundOpenfundsModel,
};
Object.keys(result).forEach((key) => {
Expand Down
2 changes: 1 addition & 1 deletion anchor/target/idl/glam.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"address": "GLAMpLuXu78TA4ao3DPZvT1zQ7woxoQ8ahdYbhnqY9mP",
"address": "Gco1pcjxCMYjKJjSNJ7mKV7qezeUTE7arXJgy7PAPNRc",
"metadata": {
"name": "glam",
"version": "0.3.1",
Expand Down
6 changes: 4 additions & 2 deletions anchor/tests/glam_crud.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ describe("glam_crud", () => {

const fund = await glamClient.fetchFund(fundPDA);
expect(fund.shareClasses.length).toEqual(1);
expect(fund.shareClasses[0].allowlist).toEqual([glamClient.getManager()]);
expect(fund.shareClasses[0].blocklist).toEqual([]);
expect(fund.shareClasses[0].shareClassAllowlist).toEqual([
glamClient.getManager(),
]);
expect(fund.shareClasses[0].shareClassBlocklist).toEqual([]);
});

it("Update fund name", async () => {
Expand Down

0 comments on commit 5ed20d2

Please sign in to comment.