diff --git a/yarn-project/aztec-sandbox/src/examples/token.ts b/yarn-project/aztec-sandbox/src/examples/token.ts index ac549ee64365..82f85e8cd451 100644 --- a/yarn-project/aztec-sandbox/src/examples/token.ts +++ b/yarn-project/aztec-sandbox/src/examples/token.ts @@ -39,7 +39,7 @@ async function main() { logger(`Created Alice and Bob accounts: ${alice.address.toString()}, ${bob.address.toString()}`); logger('Deploying Token...'); - const token = await TokenContract.deploy(pxe, alice).send().deployed(); + const token = await TokenContract.deploy(aliceWallet, alice).send().deployed(); logger('Token deployed'); // Create the contract abstraction and link it to Alice's and Bob's wallet for future signing diff --git a/yarn-project/boxes/blank-react/src/artifacts/Blank.ts b/yarn-project/boxes/blank-react/src/artifacts/Blank.ts index e2b68ec93a92..ec4ee5e86a8b 100644 --- a/yarn-project/boxes/blank-react/src/artifacts/Blank.ts +++ b/yarn-project/boxes/blank-react/src/artifacts/Blank.ts @@ -16,7 +16,6 @@ import { EthAddressLike, FieldLike, Fr, - PXE, Point, PublicKey, Wallet, @@ -56,15 +55,15 @@ export class BlankContract extends ContractBase { /** * Creates a tx to deploy a new instance of this contract. */ - public static deploy(pxe: PXE, ) { - return new DeployMethod(Point.ZERO, pxe, BlankContractArtifact, Array.from(arguments).slice(1)); + public static deploy(wallet: Wallet, ) { + return new DeployMethod(Point.ZERO, wallet, BlankContractArtifact, Array.from(arguments).slice(1)); } /** * Creates a tx to deploy a new instance of this contract using the specified public key to derive the address. */ - public static deployWithPublicKey(publicKey: PublicKey, pxe: PXE, ) { - return new DeployMethod(publicKey, pxe, BlankContractArtifact, Array.from(arguments).slice(2)); + public static deployWithPublicKey(publicKey: PublicKey, wallet: Wallet, ) { + return new DeployMethod(publicKey, wallet, BlankContractArtifact, Array.from(arguments).slice(2)); } diff --git a/yarn-project/boxes/blank/src/artifacts/Blank.ts b/yarn-project/boxes/blank/src/artifacts/Blank.ts index e2b68ec93a92..ec4ee5e86a8b 100644 --- a/yarn-project/boxes/blank/src/artifacts/Blank.ts +++ b/yarn-project/boxes/blank/src/artifacts/Blank.ts @@ -16,7 +16,6 @@ import { EthAddressLike, FieldLike, Fr, - PXE, Point, PublicKey, Wallet, @@ -56,15 +55,15 @@ export class BlankContract extends ContractBase { /** * Creates a tx to deploy a new instance of this contract. */ - public static deploy(pxe: PXE, ) { - return new DeployMethod(Point.ZERO, pxe, BlankContractArtifact, Array.from(arguments).slice(1)); + public static deploy(wallet: Wallet, ) { + return new DeployMethod(Point.ZERO, wallet, BlankContractArtifact, Array.from(arguments).slice(1)); } /** * Creates a tx to deploy a new instance of this contract using the specified public key to derive the address. */ - public static deployWithPublicKey(publicKey: PublicKey, pxe: PXE, ) { - return new DeployMethod(publicKey, pxe, BlankContractArtifact, Array.from(arguments).slice(2)); + public static deployWithPublicKey(publicKey: PublicKey, wallet: Wallet, ) { + return new DeployMethod(publicKey, wallet, BlankContractArtifact, Array.from(arguments).slice(2)); } diff --git a/yarn-project/boxes/token/src/artifacts/Token.ts b/yarn-project/boxes/token/src/artifacts/Token.ts index 847af36910b2..90e022e43814 100644 --- a/yarn-project/boxes/token/src/artifacts/Token.ts +++ b/yarn-project/boxes/token/src/artifacts/Token.ts @@ -16,7 +16,6 @@ import { EthAddressLike, FieldLike, Fr, - PXE, Point, PublicKey, Wallet, @@ -56,15 +55,15 @@ export class TokenContract extends ContractBase { /** * Creates a tx to deploy a new instance of this contract. */ - public static deploy(pxe: PXE, admin: AztecAddressLike) { - return new DeployMethod(Point.ZERO, pxe, TokenContractArtifact, Array.from(arguments).slice(1)); + public static deploy(wallet: Wallet, admin: AztecAddressLike) { + return new DeployMethod(Point.ZERO, wallet, TokenContractArtifact, Array.from(arguments).slice(1)); } /** * Creates a tx to deploy a new instance of this contract using the specified public key to derive the address. */ - public static deployWithPublicKey(publicKey: PublicKey, pxe: PXE, admin: AztecAddressLike) { - return new DeployMethod(publicKey, pxe, TokenContractArtifact, Array.from(arguments).slice(2)); + public static deployWithPublicKey(publicKey: PublicKey, wallet: Wallet, admin: AztecAddressLike) { + return new DeployMethod(publicKey, wallet, TokenContractArtifact, Array.from(arguments).slice(2)); } diff --git a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts index f9b3c39f7e8c..4bdbad94b871 100644 --- a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts +++ b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts @@ -134,10 +134,7 @@ describe('e2e_cheat_codes', () => { }); it('can modify L2 block time', async () => { - const tx = TestContract.deploy(pxe).send(); - await tx.isMined({ interval: 0.1 }); - const receipt = await tx.getReceipt(); - const contract = await TestContract.at(receipt.contractAddress!, wallet); + const contract = await TestContract.deploy(wallet).send().deployed(); // now update time: const timestamp = await cc.eth.timestamp(); diff --git a/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts b/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts index 487f34a141c9..76a3e1d14f4f 100644 --- a/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts +++ b/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts @@ -45,8 +45,10 @@ describe('e2e_sandbox_example', () => { ////////////// LOAD SOME ACCOUNTS FROM THE SANDBOX ////////////// // The sandbox comes with a set of created accounts. Load them const accounts = await getSandboxAccountsWallets(pxe); - const alice = accounts[0].getAddress(); - const bob = accounts[1].getAddress(); + const aliceWallet = accounts[0]; + const bobWallet = accounts[1]; + const alice = aliceWallet.getAddress(); + const bob = bobWallet.getAddress(); logger(`Loaded alice's account at ${alice.toShortString()}`); logger(`Loaded bob's account at ${bob.toShortString()}`); // docs:end:load_accounts @@ -58,11 +60,11 @@ describe('e2e_sandbox_example', () => { logger(`Deploying token contract...`); // Deploy the contract and set Alice as the admin while doing so - const contract = await TokenContract.deploy(pxe, alice).send().deployed(); + const contract = await TokenContract.deploy(aliceWallet, alice).send().deployed(); logger(`Contract successfully deployed at address ${contract.address.toShortString()}`); // Create the contract abstraction and link it to Alice's wallet for future signing - const tokenContractAlice = await TokenContract.at(contract.address, accounts[0]); + const tokenContractAlice = await TokenContract.at(contract.address, aliceWallet); // Create a secret and a corresponding hash that will be used to mint funds privately const aliceSecret = Fr.random(); @@ -92,7 +94,7 @@ describe('e2e_sandbox_example', () => { // Bob wants to mint some funds, the contract is already deployed, create an abstraction and link it his wallet // Since we already have a token link, we can simply create a new instance of the contract linked to Bob's wallet - const tokenContractBob = tokenContractAlice.withWallet(accounts[1]); + const tokenContractBob = tokenContractAlice.withWallet(bobWallet); let aliceBalance = await tokenContractAlice.methods.balance_of_private(alice).view(); logger(`Alice's balance ${aliceBalance}`); diff --git a/yarn-project/noir-compiler/src/contract-interface-gen/typescript.ts b/yarn-project/noir-compiler/src/contract-interface-gen/typescript.ts index db9a2479876e..3712cb8346ce 100644 --- a/yarn-project/noir-compiler/src/contract-interface-gen/typescript.ts +++ b/yarn-project/noir-compiler/src/contract-interface-gen/typescript.ts @@ -69,15 +69,15 @@ function generateDeploy(input: ContractArtifact) { /** * Creates a tx to deploy a new instance of this contract. */ - public static deploy(pxe: PXE, ${args}) { - return new DeployMethod<${input.name}Contract>(Point.ZERO, pxe, ${artifactName}, Array.from(arguments).slice(1)); + public static deploy(wallet: Wallet, ${args}) { + return new DeployMethod<${input.name}Contract>(Point.ZERO, wallet, ${artifactName}, Array.from(arguments).slice(1)); } /** * Creates a tx to deploy a new instance of this contract using the specified public key to derive the address. */ - public static deployWithPublicKey(publicKey: PublicKey, pxe: PXE, ${args}) { - return new DeployMethod<${input.name}Contract>(publicKey, pxe, ${artifactName}, Array.from(arguments).slice(2)); + public static deployWithPublicKey(publicKey: PublicKey, wallet: Wallet, ${args}) { + return new DeployMethod<${input.name}Contract>(publicKey, wallet, ${artifactName}, Array.from(arguments).slice(2)); } `; } @@ -185,7 +185,6 @@ import { EthAddressLike, FieldLike, Fr, - PXE, Point, PublicKey, Wallet,