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 1
1
import mongoose from "mongoose" ;
2
2
3
- interface IPool {
3
+ export interface IPool {
4
4
_id : mongoose . ObjectId
5
5
poolAddress : string ;
6
6
owner : string ;
@@ -29,7 +29,7 @@ interface IPool {
29
29
createdAt : Date
30
30
} ;
31
31
32
- const PoolSchema = new mongoose . Schema < IPool > ( {
32
+ export const PoolSchema = new mongoose . Schema < IPool > ( {
33
33
poolAddress : {
34
34
type : String ,
35
35
required : true ,
@@ -141,8 +141,6 @@ const PoolSchema = new mongoose.Schema<IPool>({
141
141
}
142
142
} ) ;
143
143
144
- export const PoolModel = mongoose . models . Pool || mongoose . model < IPool > ( 'Pool' , PoolSchema ) ;
145
-
146
144
export type BaseInfo = {
147
145
poolAddress : string ;
148
146
owner : string ;
Original file line number Diff line number Diff line change
1
+ import mongoose from 'mongoose' ;
1
2
import { formatEther } from 'ethers' ;
2
3
import { getPoolInfo } from "./getPoolInfo.js" ;
3
- import { PoolModel } from "./types.js" ;
4
4
import { getMaxStakeAmountPerLicense } from "./getMaxStakeAmountPerLicense.js" ;
5
5
import { getTierIndexByStakedAmount } from "./getTierIndexByStakedAmount.js" ;
6
+ import { IPool , PoolSchema } from './types.js' ;
6
7
import { config } from "../config.js" ;
7
8
8
9
const POOL_SHARES_BASE = 10_000 ;
@@ -15,6 +16,8 @@ export async function updatePoolInDB(
15
16
poolAddress : string
16
17
) : Promise < void > {
17
18
19
+ const PoolModel = mongoose . models . Pool || mongoose . model < IPool > ( 'Pool' , PoolSchema ) ;
20
+
18
21
//Load poolInfo from blockchain
19
22
const poolInfo = await getPoolInfo ( poolAddress ) ;
20
23
const baseInfo = poolInfo . baseInfo ;
You can’t perform that action at this time.
0 commit comments