1- import { EasyPrivateVotingContract } from "../src/artifacts/EasyPrivateVoting.js"
21import { AccountWallet , CompleteAddress , createLogger , Fr , PXE , waitForPXE , createPXEClient , Logger } from "@aztec/aztec.js" ;
32import { getSchnorrAccount } from '@aztec/accounts/schnorr' ;
43import { deriveSigningKey } from '@aztec/stdlib/keys' ;
54import { getInitialTestAccountsWallets } from "@aztec/accounts/testing" ;
6- import { TokenContract } from "@aztec/noir-contracts.js/Token"
5+ import { SponsoredFeePaymentMethod } from "../src/test/sponsored_fee_payment_method.js" ;
6+
77
88const setupSandbox = async ( ) => {
99 const { PXE_URL = 'http://localhost:8080' } = process . env ;
@@ -23,17 +23,16 @@ async function main() {
2323
2424 pxe = await setupSandbox ( ) ;
2525 wallets = await getInitialTestAccountsWallets ( pxe ) ;
26+ const sponsoredPaymentMethod = await SponsoredFeePaymentMethod . new ( pxe ) ;
2627
2728 let secretKey = Fr . random ( ) ;
2829 let salt = Fr . random ( ) ;
2930
3031 let schnorrAccount = await getSchnorrAccount ( pxe , secretKey , deriveSigningKey ( secretKey ) , salt ) ;
31- const { address, publicKeys, partialAddress } = await schnorrAccount . getCompleteAddress ( )
32- let tx = await schnorrAccount . deploy ( ) . wait ( ) ;
32+ let tx = await schnorrAccount . deploy ( { fee : { paymentMethod : sponsoredPaymentMethod } } ) . wait ( ) ;
3333 let wallet = await schnorrAccount . getWallet ( ) ;
3434
35- const votingContract = await EasyPrivateVotingContract . deploy ( wallet , address ) . send ( ) . deployed ( ) ;
36- logger . info ( `Voting Contract deployed at: ${ votingContract . address } ` ) ;
35+ logger . info ( `Schnorr account deployed at: ${ wallet . getAddress ( ) } ` ) ;
3736}
3837
3938main ( ) ;
0 commit comments