File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
packages/core/src/data-centralization Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11import mongoose from "mongoose" ;
22
3- interface IPool {
3+ export interface IPool {
44 _id : mongoose . ObjectId
55 poolAddress : string ;
66 owner : string ;
@@ -29,7 +29,7 @@ interface IPool {
2929 createdAt : Date
3030} ;
3131
32- const PoolSchema = new mongoose . Schema < IPool > ( {
32+ export const PoolSchema = new mongoose . Schema < IPool > ( {
3333 poolAddress : {
3434 type : String ,
3535 required : true ,
@@ -141,8 +141,6 @@ const PoolSchema = new mongoose.Schema<IPool>({
141141 }
142142} ) ;
143143
144- export const PoolModel = mongoose . models . Pool || mongoose . model < IPool > ( 'Pool' , PoolSchema ) ;
145-
146144export type BaseInfo = {
147145 poolAddress : string ;
148146 owner : string ;
Original file line number Diff line number Diff line change 1+ import mongoose from 'mongoose' ;
12import { formatEther } from 'ethers' ;
23import { getPoolInfo } from "./getPoolInfo.js" ;
3- import { PoolModel } from "./types.js" ;
44import { getMaxStakeAmountPerLicense } from "./getMaxStakeAmountPerLicense.js" ;
55import { getTierIndexByStakedAmount } from "./getTierIndexByStakedAmount.js" ;
6+ import { IPool , PoolSchema } from './types.js' ;
67import { config } from "../config.js" ;
78
89const POOL_SHARES_BASE = 10_000 ;
@@ -15,6 +16,8 @@ export async function updatePoolInDB(
1516 poolAddress : string
1617) : Promise < void > {
1718
19+ const PoolModel = mongoose . models . Pool || mongoose . model < IPool > ( 'Pool' , PoolSchema ) ;
20+
1821 //Load poolInfo from blockchain
1922 const poolInfo = await getPoolInfo ( poolAddress ) ;
2023 const baseInfo = poolInfo . baseInfo ;
You can’t perform that action at this time.
0 commit comments