@@ -112,12 +112,6 @@ export class SuiPricePusher implements IPricePusher {
112112 private readonly provider : SuiClient ,
113113 private logger : Logger ,
114114 private priceServiceConnection : PriceServiceConnection ,
115- private pythPackageId : string ,
116- private pythStateId : string ,
117- private wormholePackageId : string ,
118- private wormholeStateId : string ,
119- endpoint : string ,
120- keypair : Ed25519Keypair ,
121115 private gasBudget : number ,
122116 private gasPool : SuiObjectRef [ ] ,
123117 private pythClient : SuiPythClient
@@ -180,14 +174,6 @@ export class SuiPricePusher implements IPricePusher {
180174 }
181175
182176 const provider = new SuiClient ( { url : endpoint } ) ;
183- const pythPackageId = await SuiPricePusher . getPackageId (
184- provider ,
185- pythStateId
186- ) ;
187- const wormholePackageId = await SuiPricePusher . getPackageId (
188- provider ,
189- wormholeStateId
190- ) ;
191177
192178 const gasPool = await SuiPricePusher . initializeGasPool (
193179 keypair ,
@@ -208,12 +194,6 @@ export class SuiPricePusher implements IPricePusher {
208194 provider ,
209195 logger ,
210196 priceServiceConnection ,
211- pythPackageId ,
212- pythStateId ,
213- wormholePackageId ,
214- wormholeStateId ,
215- endpoint ,
216- keypair ,
217197 gasBudget ,
218198 gasPool ,
219199 pythClient
@@ -337,7 +317,7 @@ export class SuiPricePusher implements IPricePusher {
337317 ignoreGasObjects : string [ ] ,
338318 logger : Logger
339319 ) : Promise < SuiObjectRef [ ] > {
340- const signerAddress = await signer . toSuiAddress ( ) ;
320+ const signerAddress = signer . toSuiAddress ( ) ;
341321
342322 if ( ignoreGasObjects . length > 0 ) {
343323 logger . info (
@@ -383,25 +363,20 @@ export class SuiPricePusher implements IPricePusher {
383363 }
384364
385365 // Attempt to refresh the version of the provided object reference to point to the current version
386- // of the object. Return the provided object reference if an error occurs or the object could not
387- // be retrieved.
366+ // of the object. Throws an error if the object cannot be refreshed.
388367 private static async tryRefreshObjectReference (
389368 provider : SuiClient ,
390369 ref : SuiObjectRef
391370 ) : Promise < SuiObjectRef > {
392- try {
393- const objectResponse = await provider . getObject ( { id : ref . objectId } ) ;
394- if ( objectResponse . data !== undefined ) {
395- return {
396- digest : objectResponse . data ! . digest ,
397- objectId : objectResponse . data ! . objectId ,
398- version : objectResponse . data ! . version ,
399- } ;
400- } else {
401- return ref ;
402- }
403- } catch ( error ) {
404- return ref ;
371+ const objectResponse = await provider . getObject ( { id : ref . objectId } ) ;
372+ if ( objectResponse . data !== undefined ) {
373+ return {
374+ digest : objectResponse . data ! . digest ,
375+ objectId : objectResponse . data ! . objectId ,
376+ version : objectResponse . data ! . version ,
377+ } ;
378+ } else {
379+ throw new Error ( "Failed to refresh object reference" ) ;
405380 }
406381 }
407382
0 commit comments