1
- import { AssetConfig , AssetData , BalanceChangeType , calculatePresentValue , Evaa , EvaaUser , MAINNET_POOL_CONFIG , MASTER_CONSTANTS , MasterConfig , MasterConstants , mulFactor , predictAPY , Prices , PricesCollector , RawPriceData , TON_MAINNET , UserDataActive , verifyPricesSign , verifyRawPriceDataSign } from "../../src" ;
1
+ import { AssetConfig , AssetData , BalanceChangeType , calculatePresentValue , Evaa , EvaaUser , ExtendedAssetData , MAINNET_POOL_CONFIG , MASTER_CONSTANTS , MasterConfig , MasterConstants , mulFactor , predictAPY , Prices , PricesCollector , RawPriceData , TON_MAINNET , UserDataActive , verifyPricesSign , verifyRawPriceDataSign } from "../../src" ;
2
2
import { Dictionary , OpenedContract , TonClient } from "@ton/ton" ;
3
3
4
4
import dotenv from 'dotenv' ;
@@ -7,10 +7,10 @@ describe('parseUserData test', () => {
7
7
dotenv . config ( ) ;
8
8
let clientMainNet ;
9
9
let evaaMainNet : OpenedContract < Evaa > ;
10
- let assetsData : Dictionary < bigint , AssetData > ;
10
+ let assetsData : Dictionary < bigint , ExtendedAssetData > ;
11
11
let assetsConfig : Dictionary < bigint , AssetConfig > ;
12
12
let masterConstants : MasterConstants ;
13
- let tonData : AssetData ;
13
+ let tonData : ExtendedAssetData ;
14
14
let tonConfig : AssetConfig ;
15
15
let totalSupply : bigint ;
16
16
let totalBorrow : bigint ;
@@ -63,4 +63,15 @@ describe('parseUserData test', () => {
63
63
64
64
expect ( predicted . borrowInterest ) . toEqual ( tonConfig . baseBorrowRate ) ;
65
65
} ) ;
66
+
67
+ test ( 'test 0 value' , ( ) => {
68
+ const predicted = predictAPY ( {
69
+ amount : 0n ,
70
+ balanceChangeType : BalanceChangeType . Repay ,
71
+ assetData : tonData ,
72
+ assetConfig : tonConfig ,
73
+ masterConstants : masterConstants
74
+ } ) ;
75
+ expect ( predicted . borrowInterest ) . toEqual ( tonData . borrowInterest ) ;
76
+ } ) ;
66
77
} ) ;
0 commit comments