@@ -14,7 +14,6 @@ import {
1414 type ContractInstanceWithAddress ,
1515 type ContractMethod ,
1616 type ContractStorageLayout ,
17- type ContractNotes ,
1817 decodeFromAbi ,
1918 DeployMethod ,
2019 EthAddress ,
@@ -26,29 +25,28 @@ import {
2625 loadContractArtifact ,
2726 loadContractArtifactForPublic ,
2827 type NoirCompiledContract ,
29- NoteSelector ,
3028 Point ,
3129 type PublicKey ,
3230 PublicKeys ,
3331 type Wallet ,
3432 type U128Like ,
3533 type WrappedFieldLike ,
3634} from '@aztec/aztec.js' ;
37- import EasyPrivateVotingContractArtifactJson from './private_voting-EasyPrivateVoting .json' with { type : 'json' } ;
38- export const EasyPrivateVotingContractArtifact = loadContractArtifact ( EasyPrivateVotingContractArtifactJson as NoirCompiledContract ) ;
35+ import PrivateVotingContractArtifactJson from './private_voting-PrivateVoting .json' with { type : 'json' } ;
36+ export const PrivateVotingContractArtifact = loadContractArtifact ( PrivateVotingContractArtifactJson as NoirCompiledContract ) ;
3937
4038
4139
4240/**
43- * Type-safe interface for contract EasyPrivateVoting ;
41+ * Type-safe interface for contract PrivateVoting ;
4442 */
45- export class EasyPrivateVotingContract extends ContractBase {
43+ export class PrivateVotingContract extends ContractBase {
4644
4745 private constructor (
4846 instance : ContractInstanceWithAddress ,
4947 wallet : Wallet ,
5048 ) {
51- super ( instance , EasyPrivateVotingContractArtifact , wallet ) ;
49+ super ( instance , PrivateVotingContractArtifact , wallet ) ;
5250 }
5351
5452
@@ -63,36 +61,36 @@ export class EasyPrivateVotingContract extends ContractBase {
6361 address : AztecAddress ,
6462 wallet : Wallet ,
6563 ) {
66- return Contract . at ( address , EasyPrivateVotingContract . artifact , wallet ) as Promise < EasyPrivateVotingContract > ;
64+ return Contract . at ( address , PrivateVotingContract . artifact , wallet ) as Promise < PrivateVotingContract > ;
6765 }
6866
6967
7068 /**
7169 * Creates a tx to deploy a new instance of this contract.
7270 */
7371 public static deploy ( wallet : Wallet , admin : AztecAddressLike ) {
74- return new DeployMethod < EasyPrivateVotingContract > ( PublicKeys . default ( ) , wallet , EasyPrivateVotingContractArtifact , EasyPrivateVotingContract . at , Array . from ( arguments ) . slice ( 1 ) ) ;
72+ return new DeployMethod < PrivateVotingContract > ( PublicKeys . default ( ) , wallet , PrivateVotingContractArtifact , PrivateVotingContract . at , Array . from ( arguments ) . slice ( 1 ) ) ;
7573 }
7674
7775 /**
7876 * Creates a tx to deploy a new instance of this contract using the specified public keys hash to derive the address.
7977 */
8078 public static deployWithPublicKeys ( publicKeys : PublicKeys , wallet : Wallet , admin : AztecAddressLike ) {
81- return new DeployMethod < EasyPrivateVotingContract > ( publicKeys , wallet , EasyPrivateVotingContractArtifact , EasyPrivateVotingContract . at , Array . from ( arguments ) . slice ( 2 ) ) ;
79+ return new DeployMethod < PrivateVotingContract > ( publicKeys , wallet , PrivateVotingContractArtifact , PrivateVotingContract . at , Array . from ( arguments ) . slice ( 2 ) ) ;
8280 }
8381
8482 /**
8583 * Creates a tx to deploy a new instance of this contract using the specified constructor method.
8684 */
87- public static deployWithOpts < M extends keyof EasyPrivateVotingContract [ 'methods' ] > (
85+ public static deployWithOpts < M extends keyof PrivateVotingContract [ 'methods' ] > (
8886 opts : { publicKeys ?: PublicKeys ; method ?: M ; wallet : Wallet } ,
89- ...args : Parameters < EasyPrivateVotingContract [ 'methods' ] [ M ] >
87+ ...args : Parameters < PrivateVotingContract [ 'methods' ] [ M ] >
9088 ) {
91- return new DeployMethod < EasyPrivateVotingContract > (
89+ return new DeployMethod < PrivateVotingContract > (
9290 opts . publicKeys ?? PublicKeys . default ( ) ,
9391 opts . wallet ,
94- EasyPrivateVotingContractArtifact ,
95- EasyPrivateVotingContract . at ,
92+ PrivateVotingContractArtifact ,
93+ PrivateVotingContract . at ,
9694 Array . from ( arguments ) . slice ( 1 ) ,
9795 opts . method ?? 'constructor' ,
9896 ) ;
@@ -104,14 +102,14 @@ export class EasyPrivateVotingContract extends ContractBase {
104102 * Returns this contract's artifact.
105103 */
106104 public static get artifact ( ) : ContractArtifact {
107- return EasyPrivateVotingContractArtifact ;
105+ return PrivateVotingContractArtifact ;
108106 }
109107
110108 /**
111109 * Returns this contract's artifact with public bytecode.
112110 */
113111 public static get artifactForPublic ( ) : ContractArtifact {
114- return loadContractArtifactForPublic ( EasyPrivateVotingContractArtifactJson as NoirCompiledContract ) ;
112+ return loadContractArtifactForPublic ( PrivateVotingContractArtifactJson as NoirCompiledContract ) ;
115113 }
116114
117115
@@ -133,15 +131,6 @@ active_at_block: {
133131 }
134132
135133
136- public static get notes ( ) : ContractNotes < 'ValueNote' > {
137- return {
138- ValueNote : {
139- id : new NoteSelector ( 0 ) ,
140- }
141- } as ContractNotes < 'ValueNote' > ;
142- }
143-
144-
145134 /** Type-safe wrappers for the public methods exposed by the contract. */
146135 public declare methods : {
147136
@@ -157,6 +146,9 @@ active_at_block: {
157146 /** get_vote(candidate: field) */
158147 get_vote : ( ( candidate : FieldLike ) => ContractFunctionInteraction ) & Pick < ContractMethod , 'selector' > ;
159148
149+ /** process_message(message_ciphertext: struct, message_context: struct) */
150+ process_message : ( ( message_ciphertext : FieldLike [ ] , message_context : { tx_hash : FieldLike , unique_note_hashes_in_tx : FieldLike [ ] , first_nullifier_in_tx : FieldLike , recipient : AztecAddressLike } ) => ContractFunctionInteraction ) & Pick < ContractMethod , 'selector' > ;
151+
160152 /** public_dispatch(selector: field) */
161153 public_dispatch : ( ( selector : FieldLike ) => ContractFunctionInteraction ) & Pick < ContractMethod , 'selector' > ;
162154
0 commit comments