@@ -2,6 +2,7 @@ import type { FeeOptions, TxExecutionOptions, UserFeeOptions } from '@aztec/entr
22import type { ExecutionPayload } from '@aztec/entrypoints/payload' ;
33import { createLogger } from '@aztec/foundation/log' ;
44import type { AuthWitness } from '@aztec/stdlib/auth-witness' ;
5+ import { AztecAddress } from '@aztec/stdlib/aztec-address' ;
56import { GasSettings } from '@aztec/stdlib/gas' ;
67import type { Capsule , TxExecutionRequest , TxProvingResult } from '@aztec/stdlib/tx' ;
78
@@ -48,6 +49,11 @@ export abstract class BaseContractInteraction {
4849 * @returns The proving result.
4950 */
5051 protected async proveInternal ( options : SendMethodOptions ) : Promise < TxProvingResult > {
52+ if ( options . from !== AztecAddress . ZERO && ! options . from . equals ( this . wallet . getAddress ( ) ) ) {
53+ throw new Error (
54+ `The address provided as from does not match the wallet address. Expected ${ this . wallet . getAddress ( ) . toString ( ) } , got ${ options . from . toString ( ) } .` ,
55+ ) ;
56+ }
5157 const txRequest = await this . create ( options ) ;
5258 return await this . wallet . proveTx ( txRequest ) ;
5359 }
@@ -60,11 +66,6 @@ export abstract class BaseContractInteraction {
6066 */
6167 public async prove ( options : SendMethodOptions ) : Promise < ProvenTx > {
6268 // docs:end:prove
63- if ( ! options . from . equals ( this . wallet . getAddress ( ) ) ) {
64- throw new Error (
65- `The address provided as from does not match the wallet address. Expected ${ this . wallet . getAddress ( ) . toString ( ) } , got ${ options . from . toString ( ) } .` ,
66- ) ;
67- }
6869 const txProvingResult = await this . proveInternal ( options ) ;
6970 return new ProvenTx (
7071 this . wallet ,
0 commit comments