Skip to content

Commit 1ddf1a5

Browse files
authored
Merge pull request #95 from codeesura/main
fix(imports): resolve type imports and remove unused dependencies
2 parents b2c8003 + 456e464 commit 1ddf1a5

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

scripts/deploy_contract.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { EasyPrivateVotingContract } from "../src/artifacts/EasyPrivateVoting.js"
22
import { createLogger, PXE, Logger, SponsoredFeePaymentMethod, Fr } from "@aztec/aztec.js";
3-
import { TokenContract } from "@aztec/noir-contracts.js/Token"
43
import { setupPXE } from "../src/utils/setup_pxe.js";
54
import { getSponsoredFPCInstance } from "../src/utils/sponsored_fpc.js";
65
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
@@ -21,7 +20,7 @@ async function main() {
2120

2221
let accountManager = await deploySchnorrAccount(pxe);
2322
const wallet = await accountManager.getWallet();
24-
const address = await accountManager.getAddress();
23+
const address = accountManager.getAddress();
2524

2625
const votingContract = await EasyPrivateVotingContract.deploy(wallet, address).send({ fee: { paymentMethod: sponsoredPaymentMethod } }).deployed();
2726
logger.info(`Voting Contract deployed at: ${votingContract.address}`);

scripts/fees.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ import { deriveSigningKey } from '@aztec/stdlib/keys';
2323
const MNEMONIC = 'test test test test test test test test test test test junk';
2424
const FEE_FUNDING_FOR_TESTER_ACCOUNT = 1000000000000000000n;
2525

26-
let walletClient = getL1WalletClient(foundry.rpcUrls.default.http[0], 0);
27-
const ownerEthAddress = walletClient.account.address;
28-
2926
async function main() {
3027

3128
let pxe: PXE;

scripts/multiple_pxe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function main() {
6969
let schnorrAccount = await getSchnorrAccount(pxe1, secretKey, deriveSigningKey(secretKey), salt);
7070
let tx = await schnorrAccount.deploy({ fee: { paymentMethod } }).wait();
7171
let ownerWallet = await schnorrAccount.getWallet();
72-
let ownerAddress = await ownerWallet.getAddress();
72+
let ownerAddress = ownerWallet.getAddress();
7373
const token = await TokenContract.deploy(ownerWallet, ownerAddress, 'Clean USDC', 'USDC', 6).send({ contractAddressSalt: L2_TOKEN_CONTRACT_SALT, fee: { paymentMethod } }).wait()
7474

7575
// setup account on 2nd pxe
@@ -114,7 +114,7 @@ async function main() {
114114
const balance = await l2TokenContract.methods.balance_of_private(wallet2.getAddress()).simulate()
115115
console.log("private balance should be 100", balance)
116116
// errors
117-
const public_balance = await l2TokenContract.methods.balance_of_public(wallet2.getAddress()).simulate()
117+
await l2TokenContract.methods.balance_of_public(wallet2.getAddress()).simulate()
118118

119119
}
120120

src/utils/deploy_account.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { AccountWallet, CompleteAddress, createLogger, Fr, PXE, waitForPXE, createPXEClient, Logger, AccountWalletWithSecretKey, AccountManager } from "@aztec/aztec.js";
1+
import { createLogger, Fr, AccountManager } from "@aztec/aztec.js";
2+
import type { PXE, Logger } from "@aztec/aztec.js";
23
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
34
import { deriveSigningKey } from '@aztec/stdlib/keys';
4-
import { getInitialTestAccountsWallets } from "@aztec/accounts/testing";
55
import { SponsoredFeePaymentMethod } from "@aztec/aztec.js/fee/testing";
66
import { getSponsoredFPCInstance } from "./sponsored_fpc.js";
7-
import { setupPXE } from "./setup_pxe.js";
87
import { SponsoredFPCContract } from "@aztec/noir-contracts.js/SponsoredFPC";
98

109
export async function deploySchnorrAccount(pxe: PXE): Promise<AccountManager> {
@@ -20,7 +19,7 @@ export async function deploySchnorrAccount(pxe: PXE): Promise<AccountManager> {
2019
let salt = Fr.random();
2120

2221
let schnorrAccount = await getSchnorrAccount(pxe, secretKey, deriveSigningKey(secretKey), salt);
23-
let tx = await schnorrAccount.deploy({ fee: { paymentMethod: sponsoredPaymentMethod } }).wait();
22+
await schnorrAccount.deploy({ fee: { paymentMethod: sponsoredPaymentMethod } }).wait();
2423
let wallet = await schnorrAccount.getWallet();
2524

2625
logger.info(`Schnorr account deployed at: ${wallet.getAddress()}`);

0 commit comments

Comments
 (0)