@@ -290,7 +290,7 @@ class OfflineKeyProvider implements FunctionKeyProvider {
290
290
const provingKey = ProvingKey . fromBytes ( provingKeyBytes ) ;
291
291
const verifyingKey = VerifyingKey . fromBytes ( verifyingKeyBytes ) ;
292
292
if ( verifyCreditsKeys ) {
293
- const keysMatchExpected = this . verifyCreditsKeys ( keyId , provingKey , verifyingKey )
293
+ const keysMatchExpected = this . verifyCreditsKeys ( { locator : keyId , provingKey, verifyingKey } )
294
294
if ( ! keysMatchExpected ) {
295
295
reject ( new Error ( `Cached keys do not match expected keys for ${ keyId } ` ) ) ;
296
296
}
@@ -306,9 +306,18 @@ class OfflineKeyProvider implements FunctionKeyProvider {
306
306
/**
307
307
* Determines if the keys for a given credits function match the expected keys.
308
308
*
309
+ * @param {Object } params
310
+ * @param {ProvingKey } params.provingKey
311
+ * @param {VerifyingKey } params.verifyingKey
309
312
* @returns {boolean } Whether the keys match the expected keys
310
313
*/
311
- verifyCreditsKeys ( locator : string , provingKey : ProvingKey , verifyingKey : VerifyingKey ) : boolean {
314
+ verifyCreditsKeys ( params : {
315
+ locator : string ,
316
+ provingKey : ProvingKey ,
317
+ verifyingKey : VerifyingKey ,
318
+ } ) : boolean {
319
+ const { locator, provingKey, verifyingKey } = params ;
320
+
312
321
switch ( locator ) {
313
322
case CREDITS_PROGRAM_KEYS . bond_public . locator :
314
323
return provingKey . isBondPublicProver ( ) && verifyingKey . isBondPublicVerifier ( ) ;
0 commit comments