@@ -14,7 +14,7 @@ import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
1414
1515import { publishContractClass } from '../deployment/publish_class.js' ;
1616import { publishInstance } from '../deployment/publish_instance.js' ;
17- import type { SendOptions , Wallet } from '../wallet/wallet.js' ;
17+ import type { ProfileOptions , SendOptions , SimulateOptions , Wallet } from '../wallet/wallet.js' ;
1818import { BaseContractInteraction } from './base_contract_interaction.js' ;
1919import type { ContractBase } from './contract_base.js' ;
2020import { ContractFunctionInteraction } from './contract_function_interaction.js' ;
@@ -207,7 +207,7 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
207207 * @param options - Deploy options with wait parameter
208208 * @returns Send options with wait parameter
209209 */
210- private convertDeployOptionsToSendOptions < W extends DeployInteractionWaitOptions > (
210+ protected convertDeployOptionsToSendOptions < W extends DeployInteractionWaitOptions > (
211211 options : DeployOptions < W > ,
212212 // eslint-disable-next-line jsdoc/require-jsdoc
213213 ) : SendOptions < W extends { returnReceipt : true } ? WaitOpts : W > {
@@ -219,6 +219,24 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
219219 } as any ;
220220 }
221221
222+ /**
223+ * Converts deploy simulation options into wallet-level simulate options.
224+ * @param options - The deploy simulation options to convert.
225+ */
226+ protected convertDeployOptionsToSimulateOptions ( options : SimulateDeployOptions ) : SimulateOptions {
227+ return toSimulateOptions ( options ) ;
228+ }
229+
230+ /**
231+ * Converts deploy profile options into wallet-level profile options.
232+ * @param options - The deploy profile options to convert.
233+ */
234+ protected convertDeployOptionsToProfileOptions (
235+ options : DeployOptionsWithoutWait & ProfileInteractionOptions ,
236+ ) : ProfileOptions {
237+ return toProfileOptions ( options ) ;
238+ }
239+
222240 /**
223241 * Adds this contract to the wallet and returns the Contract object.
224242 * @param options - Deployment options.
@@ -368,7 +386,10 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
368386 */
369387 public async simulate ( options : SimulateDeployOptions ) : Promise < SimulationReturn < true > > {
370388 const executionPayload = await this . request ( this . convertDeployOptionsToRequestOptions ( options ) ) ;
371- const simulatedTx = await this . wallet . simulateTx ( executionPayload , toSimulateOptions ( options ) ) ;
389+ const simulatedTx = await this . wallet . simulateTx (
390+ executionPayload ,
391+ this . convertDeployOptionsToSimulateOptions ( options ) ,
392+ ) ;
372393
373394 const { gasLimits, teardownGasLimits } = getGasLimits ( simulatedTx , options . fee ?. estimatedGasPadding ) ;
374395 this . log . verbose (
@@ -390,11 +411,7 @@ export class DeployMethod<TContract extends ContractBase = ContractBase> extends
390411 */
391412 public async profile ( options : DeployOptionsWithoutWait & ProfileInteractionOptions ) : Promise < TxProfileResult > {
392413 const executionPayload = await this . request ( this . convertDeployOptionsToRequestOptions ( options ) ) ;
393- return await this . wallet . profileTx ( executionPayload , {
394- ...toProfileOptions ( options ) ,
395- profileMode : options . profileMode ,
396- skipProofGeneration : options . skipProofGeneration ,
397- } ) ;
414+ return await this . wallet . profileTx ( executionPayload , this . convertDeployOptionsToProfileOptions ( options ) ) ;
398415 }
399416
400417 /** Return this deployment address. */
0 commit comments