@@ -25,6 +25,7 @@ import { deriveSigningKey } from "@aztec/circuits.js";
25
25
import { FunctionType } from "@aztec/foundation/abi" ;
26
26
import { ContractClassRegisteredEvent } from "@aztec/protocol-contracts/class-registerer" ;
27
27
import {
28
+ VerifyInstanceDeploymentPayload ,
28
29
generateVerifyArtifactPayload ,
29
30
generateVerifyArtifactUrl ,
30
31
generateVerifyInstancePayload ,
@@ -51,8 +52,8 @@ export const logAndWaitForTx = async (tx: SentTx, additionalInfo: string) => {
51
52
} ;
52
53
53
54
export const getFunctionSpacer = ( type : FunctionType ) => {
54
- if ( type === FunctionType . PRIVATE ) return type + " " ;
55
- if ( type === FunctionType . UNCONSTRAINED ) return type + " " ;
55
+ if ( type === FunctionType . PRIVATE ) { return type + " " ; }
56
+ if ( type === FunctionType . UNCONSTRAINED ) { return type + " " ; }
56
57
return type + " " ;
57
58
} ;
58
59
@@ -105,9 +106,9 @@ export const getNewAccount = async (pxe: PXE, accountName: string) => {
105
106
} ;
106
107
107
108
const getNewContractClassId = async ( node : AztecNode , blockNumber ?: number ) => {
108
- if ( ! blockNumber ) return undefined ;
109
+ if ( ! blockNumber ) { return undefined ; }
109
110
const block = await node . getBlock ( blockNumber ) ;
110
- if ( ! block ) throw new Error ( `Block ${ blockNumber } not found` ) ;
111
+ if ( ! block ) { throw new Error ( `Block ${ blockNumber } not found` ) ; }
111
112
const contractClassLogs = block . body . txEffects
112
113
. flatMap ( ( txEffect ) => ( txEffect ? [ txEffect . contractClassLogs ] : [ ] ) )
113
114
. flatMap ( ( txLog ) => txLog . unrollLogs ( ) ) ;
@@ -213,7 +214,7 @@ export const publicDeployAccounts = async (
213
214
) . then ( ( results ) =>
214
215
results . filter ( ( result ) => ! result . isContractPubliclyDeployed )
215
216
) ;
216
- if ( notPubliclyDeployedAccounts . length === 0 ) return ;
217
+ if ( notPubliclyDeployedAccounts . length === 0 ) { return ; }
217
218
const deployCalls : FunctionCall [ ] = [
218
219
await (
219
220
await registerContractClass ( sender , SchnorrAccountContractArtifact )
@@ -258,28 +259,36 @@ export const registerContractClassArtifact = async (
258
259
} ) ;
259
260
} ;
260
261
261
- export const verifyContractInstanceDeployment = async (
262
- contractLoggingName : string ,
263
- artifactObj : { default : NoirCompiledContract } | NoirCompiledContract ,
264
- contractInstanceAddress : string ,
265
- publicKeysString : string ,
266
- deployer : string ,
267
- salt : string ,
268
- args : string [ ]
269
- ) => {
262
+ export const verifyContractInstanceDeployment = async ( {
263
+ contractLoggingName,
264
+ artifactObj,
265
+ contractInstanceAddress,
266
+ publicKeysString,
267
+ deployer,
268
+ salt,
269
+ args,
270
+ } : {
271
+ contractLoggingName : string ;
272
+ artifactObj : { default : NoirCompiledContract } | NoirCompiledContract ;
273
+ contractInstanceAddress : string ;
274
+ publicKeysString : string ;
275
+ deployer : string ;
276
+ salt : string ;
277
+ args : string [ ] ;
278
+ } ) => {
270
279
const url = generateVerifyInstanceUrl (
271
280
EXPLORER_API_URL ,
272
281
contractInstanceAddress
273
282
) ;
274
- const postData = JSON . stringify (
275
- generateVerifyInstancePayload ( {
276
- publicKeysString,
277
- deployer,
278
- salt,
279
- constructorArgs : args ,
280
- artifactObj,
281
- } )
282
- ) ;
283
+
284
+ const payload = generateVerifyInstancePayload ( {
285
+ publicKeysString,
286
+ deployer,
287
+ salt,
288
+ constructorArgs : args ,
289
+ artifactObj,
290
+ } ) as VerifyInstanceDeploymentPayload ;
291
+ const postData = JSON . stringify ( payload ) ;
283
292
await callExplorerApi ( {
284
293
loggingString : `🧐 verifyContractInstanceDeployment ${ contractLoggingName } ` ,
285
294
urlStr : url ,
0 commit comments