@@ -17,7 +17,6 @@ import { MarketConfiguratorContract } from "./MarketConfiguratorContract";
1717import { MarketFactory } from "./MarketFactory" ;
1818import type { PoolFactory } from "./PoolFactory" ;
1919import { rawTxToMulticallPriceUpdate } from "./pricefeeds" ;
20- import type { PriceOracleContract } from "./PriceOracleContract" ;
2120
2221export class MarketRegister extends SDKConstruct {
2322 #logger?: ILogger ;
@@ -151,15 +150,6 @@ export class MarketRegister extends SDKConstruct {
151150 throw new Error ( `cannot find credit manager ${ creditManager } ` ) ;
152151 }
153152
154- public findPriceOracle ( address : Address ) : PriceOracleContract {
155- for ( const market of this . markets ) {
156- if ( market . priceOracle . address . toLowerCase ( ) === address . toLowerCase ( ) ) {
157- return market . priceOracle ;
158- }
159- }
160- throw new Error ( `cannot find price oracle ${ address } ` ) ;
161- }
162-
163153 public findByCreditManager ( creditManager : Address ) : MarketFactory {
164154 const market = this . markets . find ( m =>
165155 m . creditManagers . some (
@@ -174,6 +164,15 @@ export class MarketRegister extends SDKConstruct {
174164 return market ;
175165 }
176166
167+ public findByPriceOracle ( address : Address ) : MarketFactory {
168+ for ( const market of this . markets ) {
169+ if ( market . priceOracle . address . toLowerCase ( ) === address . toLowerCase ( ) ) {
170+ return market ;
171+ }
172+ }
173+ throw new Error ( `cannot find price oracle ${ address } ` ) ;
174+ }
175+
177176 public get markets ( ) : MarketFactory [ ] {
178177 return this . #markets. values ( ) ;
179178 }
0 commit comments