This repository has been archived by the owner on May 7, 2024. It is now read-only.
forked from centrifuge/api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20221026 Integrate progress until sprint 14 (#22)
* 74 index loanentity data types (#86) * feat: create loanService * refactor: improved service getters * feat: increase outstandingDebt on borrowings * feat: basics for handle loan prices * feat: save priced loans * feat: activate loan when priced * feat: handle writeoffs * feat: handle loan closed and write offs * fix: loan.repay() should increase totalRepaid * fix: invest execution decimals and avoid empty transactions (#87) * 82 add prices to all investortransaction types (#88) * chore: update chain data * feat: extend InvestorTransaction decoration and refactor * feat: use rpc prices from trancheTokenPrices() when investor transactions are processed (#89) * feat: improved loans and borrower transactions (#90) * 63 convert outflows to dai (#91) * feat: add currency value for redeem fields * fix: currency conversion should support null prices * 98 failing poolservicegettranchetokenprices causes period to be skipped for remaining pools (#99) * ci: fix deployment version * fix: handle missing price updates from RPC * fix: throw errors on missing prices * feat: aggregate total investments and repayments for epoches (#100) * feat: index accounts and tranche balances (#101) * docs: add deployment status badge * Update README.md docs: fix badge link to deployment workflow * feat: tracking loans history with state snapshot (#102) * 56 handle updates to pool information poolsupdated event (#106) * chore: upgraded packages * feat: track pool updates * 103 totalinvested and totalredeemed are missing in poolsnapshot (#107) * fix: add missing properties to snapshot * deploy: update node and query versions * fix: pool investment and redemptions totals * feat: indexing missing values (#108) * ci: updated deployment * ci: upgraded packages * feat: paginated getters for snapshots and models (#109) * chore: upgrade packages * 104 track currency balances for accounts (#111) * feat: add data model for currency balances * feat: track endowments withdrawals and deposits of currency * feat: get initial balance on currency balance init * ci: revert subql/node version * 112 develop suitable unit testing approach (#117) * test: fundamental approach * test: poolHandlers testing * test: run pools and tranche tests in CI * test: include generation of entities * ci: execute testing in correct order * docs: updated data model diagram (#118) * 115 extend kpis as from spreadsheet (#119) * feat: aggregate loan writeoffs and total overdue * feat: index additional data * chore: remove unnecessary imports * feat: parse and index loanSpecs * fix: indexing of overdue amount Co-authored-by: Timon <timon@embrio.tech>
- Loading branch information
Showing
21 changed files
with
3,578 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export DB_USER=postgres | ||
export DB_PASS=postgres | ||
export DB_DATABASE=postgres | ||
export DB_HOST=localhost | ||
export DB_PORT=5432 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Jest Tests", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand"], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen" | ||
}, | ||
{ | ||
"name": "Debug SubQL Node", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/subql-node", "-f", "${workspaceRoot}"], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Config } from 'jest' | ||
|
||
const config: Config = { | ||
verbose: true, | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
setupFiles: ['./jest/globals.ts'], | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` | ||
'^.+\\.ts?$': [ | ||
'ts-jest', | ||
{ | ||
tsconfig: './jest/tsconfig.jest.json', | ||
}, | ||
], | ||
}, | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
declare const api: any | ||
declare const logger: any | ||
declare const store: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
import { jest } from '@jest/globals' | ||
|
||
const globalHere: any = global | ||
|
||
globalHere.store = { | ||
get: jest.fn(), | ||
getByField: jest.fn(), | ||
getOneByField: jest.fn(), | ||
set: jest.fn((...args) => args[2]), | ||
bulkCreate: jest.fn(), | ||
bulkUpdate: jest.fn(), | ||
remove: jest.fn(), | ||
} | ||
|
||
globalHere.logger = { | ||
fatal: jest.fn(), | ||
error: jest.fn(), | ||
warn: jest.fn(), | ||
info: jest.fn(), | ||
debug: jest.fn(), | ||
trace: jest.fn(), | ||
} | ||
|
||
globalHere.api = { query: {}, rpc: {} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"esModuleInterop": true, | ||
"declaration": true, | ||
"importHelpers": true, | ||
"resolveJsonModule": true, | ||
"module": "commonjs", | ||
"outDir": "dist", | ||
"rootDir": "src", | ||
"target": "es2017", | ||
"paths": { | ||
"centrifuge-subql/*": ["./src/*"] | ||
} | ||
}, | ||
"include": ["./src/**/*", "./jest/*.ts"], | ||
"exports": { | ||
"chaintypes": "./src/chaintypes.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.