Conversation
| const ContractMetadataSchema = z.object({ | ||
| contractInstance: z.union([ContractInstanceWithAddressSchema, z.undefined()]), | ||
| isContractInitialized: z.boolean(), | ||
| isContractPublished: z.boolean(), | ||
| }) satisfies ZodFor<ContractMetadata>; | ||
|
|
||
| const ContractClassMetadataSchema = z.object({ | ||
| contractClass: z.union([ContractClassWithIdSchema, z.undefined()]), | ||
| isContractClassPubliclyRegistered: z.boolean(), | ||
| artifact: z.union([ContractArtifactSchema, z.undefined()]), | ||
| }) satisfies ZodFor<ContractClassMetadata>; |
There was a problem hiding this comment.
This was moved here from PXE as the PXESchema got dropped.
| program = injectAztecNodeCommands(program, userLog, debugLogger); | ||
| program = injectMiscCommands(program, userLog); | ||
| program = injectDevnetCommands(program, userLog, debugLogger); | ||
| program = injectWalletCommands(program, userLog, debugLogger); |
There was a problem hiding this comment.
Agreed with Grego in DMs that it makes sense to drop the wallet commands from aztec command. Having it on aztec was just a tech debt.
1ac248a to
7b5ec83
Compare
a87ae53 to
545d3f3
Compare
| * @param testWalletOrPxe - Test wallet or pxe instance to use to get the registered accounts. | ||
| * @returns A set of key data for each of the initial accounts. | ||
| */ | ||
| export async function getDeployedTestAccounts(testWalletOrPxe: { getPxe(): PXE } | PXE): Promise<InitialAccountData[]> { |
There was a problem hiding this comment.
I replaced this with a registerInitialSandboxAccountsInWallet util that resides in the end-to-end package.
There was a problem hiding this comment.
I think I'd be fine with that utility living in the test-wallet package (people will connect the testwallet to sandbox)
| // Recently added when having the wallet instantiate PXE as PXE is now hidden. This forced me to expose this when | ||
| // refactoring `checkTx` cli-wallet command. | ||
| getContracts(): Promise<AztecAddress[]> { | ||
| return this.pxe.getContracts(); | ||
| } | ||
|
|
||
| // Recently added when having the wallet instantiate PXE as PXE is now hidden. This forced me to expose this when | ||
| // refactoring `checkTx` cli-wallet command. | ||
| getNotes(filter: NotesFilter): Promise<UniqueNote[]> { | ||
| return this.pxe.getNotes(filter); | ||
| } | ||
|
|
||
| // Recently added when having the wallet instantiate PXE as PXE is now hidden. This forced me to expose this when | ||
| // refactoring `bridge_fee_juice` cli-wallet command. | ||
| // TODO: This should most likely just be refactored to getProtocolContractAddresses. | ||
| getPXEInfo(): Promise<PXEInfo> { | ||
| return this.pxe.getPXEInfo(); | ||
| } |
There was a problem hiding this comment.
WDYT about these commands? Needed to expose them as we had the corresponding commands exposed on the CLI (getNotes was required by inspectTx and it prints out notes emitted in the tx).
As a dev being able to print out contracts and notes when debugging seems pretty useful.
There was a problem hiding this comment.
This makes sense in the CLIWallet, since it's just what it does. They do not belong in the public interface though.
| @@ -1,2 +1,32 @@ | |||
| # Aztec wallet Documentation | |||
|
|
|||
| ### Run tests locally | |||
There was a problem hiding this comment.
Grego sent me this through DMs so I made AI generate readme from it.
| } | ||
| } | ||
|
|
||
| export async function inspectTx( |
There was a problem hiding this comment.
I copied the unpruned version to the cli-wallet. It became less useful here without the private info.
| import { AztecAddress, type DeployOptions, Fr, type Wallet, publishContractClass } from '@aztec/aztec.js'; | ||
| import type { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC'; | ||
| import type { TestWallet } from '@aztec/test-wallet'; | ||
| import type { TestWallet } from '@aztec/test-wallet/server'; |
| // should be set so that the only way for rollups to be built | ||
| // is if the txs are successfully gossiped around the nodes. | ||
| const contexts: NodeContext[] = []; | ||
| const txsSentViaDifferentNodes: SentTx[][] = []; |
There was a problem hiding this comment.
Here and in the tests that follow I dropped the NodeContext type:
export interface NodeContext {
node: AztecNodeService;
pxeService: PXEService;
txs: SentTx[];
}
because only the txs from it were ever used.
|
|
||
| import type { PXEServiceConfig } from '../config/index.js'; | ||
| import { PXEService } from '../pxe_service/pxe_service.js'; | ||
| import { pxeTestSuite } from './pxe_test_suite.js'; |
There was a problem hiding this comment.
In this file I just merged the pxe_test_suite to it and moved the pxe service creation to the beforeAll block.
We had it done like this before because the pxe_test_suite was imported in e2e package.
| @@ -1,422 +0,0 @@ | |||
| import { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; | |||
There was a problem hiding this comment.
This was just testing the PXESchema and that schema no longer exists.
|
|
||
|
|
||
|
|
||
| {{- define "aztec-network.pxeUrl" -}} |
There was a problem hiding this comment.
Very scared of this, ping someone from the networks team!
There was a problem hiding this comment.
Already let Mitch know about this 👍
Apparently all of this is anyway getting completely refactored soon so seems to be a good time to do this PR.
| * @param testWalletOrPxe - Test wallet or pxe instance to use to get the registered accounts. | ||
| * @returns A set of key data for each of the initial accounts. | ||
| */ | ||
| export async function getDeployedTestAccounts(testWalletOrPxe: { getPxe(): PXE } | PXE): Promise<InitialAccountData[]> { |
There was a problem hiding this comment.
I think I'd be fine with that utility living in the test-wallet package (people will connect the testwallet to sandbox)
| // Recently added when having the wallet instantiate PXE as PXE is now hidden. This forced me to expose this when | ||
| // refactoring `checkTx` cli-wallet command. | ||
| getContracts(): Promise<AztecAddress[]> { | ||
| return this.pxe.getContracts(); | ||
| } | ||
|
|
||
| // Recently added when having the wallet instantiate PXE as PXE is now hidden. This forced me to expose this when | ||
| // refactoring `checkTx` cli-wallet command. | ||
| getNotes(filter: NotesFilter): Promise<UniqueNote[]> { | ||
| return this.pxe.getNotes(filter); | ||
| } | ||
|
|
||
| // Recently added when having the wallet instantiate PXE as PXE is now hidden. This forced me to expose this when | ||
| // refactoring `bridge_fee_juice` cli-wallet command. | ||
| // TODO: This should most likely just be refactored to getProtocolContractAddresses. | ||
| getPXEInfo(): Promise<PXEInfo> { | ||
| return this.pxe.getPXEInfo(); | ||
| } |
There was a problem hiding this comment.
This makes sense in the CLIWallet, since it's just what it does. They do not belong in the public interface though.
| salt: new Fr(SPONSORED_FPC_SALT), | ||
| }); | ||
| await pxe.registerContract({ instance: sponsoredFPCInstance, artifact: SponsoredFPCContract.artifact }); | ||
| await wallet.registerContract({ instance: sponsoredFPCInstance, artifact: SponsoredFPCContract.artifact }); |
There was a problem hiding this comment.
This is useless for a short lived command, since the contract is just registered privately on a dead wallet. It might be useful to just print the address though.
There was a problem hiding this comment.
Good catch!
Addressed in 4a2b131
The sponsored fpc flag on the cli command was useless as we did not ever deploy the FPC there.
b317da3 to
4a2b131
Compare
PXE is becoming just a lib used by the wallet and for this reason I am dropping the corresponding JSON RPC Server. This leads to a large refactor of basically all the setups that dealt with PXE and wallets. This is a followup work of [this PR](#17163) in which I had this tasks planned: 1. Drop PXE JSON RPC server, 2. have Wallet instantiate PXE instead of having it passed in as an arg to a constructor, 3. revisit the PXE methods exposed on the TestWallet. In this PR I tackled points 1 and 2.
4a2b131 to
b9e53bf
Compare
Followup work of #17228 In this PR I drop `getPXEInfo` and `getContracts` from `TestWallet` + add random docs improvements. `getPXEInfo` was just a tech debt as it was only used to check if node has the same protocol contract addresses which is quite non-sensical because those addresses are no literally 1, 2, 3, 4, 5... I assume this check is there from time when they didn't have these hardcoded addresses. `getContracts` was used just in one test and the check there was not really that important so I just dropped it.
Followup work of #17228 In this PR I drop `getPXEInfo` and `getContracts` from `TestWallet` + add random docs improvements. `getPXEInfo` was just a tech debt as it was only used to check if node has the same protocol contract addresses which is quite non-sensical because those addresses are no literally 1, 2, 3, 4, 5... I assume this check is there from time when they didn't have these hardcoded addresses. `getContracts` was used just in one test and the check there was not really that important so I just dropped it.
Followup work of #17228 In this PR I drop `getPXEInfo` and `getContracts` from `TestWallet` + add random docs improvements. `getPXEInfo` was just a tech debt as it was only used to check if node has the same protocol contract addresses which is quite non-sensical because those addresses are no literally 1, 2, 3, 4, 5... I assume this check is there from time when they didn't have these hardcoded addresses. `getContracts` was used just in one test and the check there was not really that important so I just dropped it.


PXE is becoming just a lib used by the wallet and for this reason I am dropping the corresponding JSON RPC Server.
This leads to a large refactor of basically all the setups that dealt with PXE and wallets.
This is a followup work of this PR in which I had this tasks planned:
In this PR I tackled points 1 and 2.