Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(types): relax to pass
Browse files Browse the repository at this point in the history
turadg committed Jan 9, 2025

Verified

This commit was signed with the committer’s verified signature.
turadg Turadg Aleahmad
1 parent 0e3f6c9 commit 2b2efa2
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/// <reference types="@agoric/zoe/src/contractSupport/types-ambient"/>

//Exports all handler functions
export * from './mappings/mappingHandlers';
11 changes: 10 additions & 1 deletion src/mappings/events/vaults.ts
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ export const vaultsEventKit = (block: CosmosBlock, data: StreamCell, module: str
oldState: string | undefined,
newState: string,
blockTime: ReadonlyDateWithNanoseconds,
blockHeight: number,
blockHeight: string,
): Promise<[VaultStatesDaily, VaultStatesDaily]> {
let vaultState: VaultStatesDaily | undefined = await VaultStatesDaily.get('latest');

@@ -129,10 +129,15 @@ export const vaultsEventKit = (block: CosmosBlock, data: StreamCell, module: str
vault = new Vault(path, BigInt(data.blockHeight), block.block.header.time as Date, '');
}

// @ts-expect-error see resolveBrandNamesAndValues
vault.coin = payload?.locked?.__brand;
// @ts-expect-error see resolveBrandNamesAndValues
vault.denom = payload?.locked?.__brand;
// @ts-expect-error see resolveBrandNamesAndValues
vault.debt = BigInt(payload?.debtSnapshot?.debt?.__value);
// @ts-expect-error see resolveBrandNamesAndValues
vault.balance = BigInt(payload?.locked?.__value);
// @ts-expect-error see resolveBrandNamesAndValues
vault.lockedValue = BigInt(payload?.locked?.__value);
vault.state = payload?.vaultState;

@@ -148,6 +153,7 @@ export const vaultsEventKit = (block: CosmosBlock, data: StreamCell, module: str
const id = `${path}-${payload?.vaultState}`;
const liquidatingId = `${path}-${VAULT_STATES.LIQUIDATING}`;

// @ts-expect-error see resolveBrandNamesAndValues
const denom = payload?.locked?.__brand;

let vault = await VaultLiquidation.get(id);
@@ -187,8 +193,11 @@ export const vaultsEventKit = (block: CosmosBlock, data: StreamCell, module: str

vault.coin = denom;
vault.denom = denom;
// @ts-expect-error see resolveBrandNamesAndValues
vault.debt = payload?.debtSnapshot?.debt?.__value;
// @ts-expect-error see resolveBrandNamesAndValues
vault.balance = payload?.locked?.__value;
// @ts-expect-error see resolveBrandNamesAndValues
vault.lockedValue = payload?.locked?.__value;
vault.state = payload?.vaultState;
return vault.save();
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
"rootDir": "src",
"target": "es2017",
"strict": true,
"noImplicitAny": false,
// UNTIL package-json-type and ejs packages have types
"skipLibCheck": true,
"lib": ["es2021"]

0 comments on commit 2b2efa2

Please sign in to comment.