Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
sklppy88 committed Oct 11, 2024
1 parent 8adbdd5 commit b1d4492
Show file tree
Hide file tree
Showing 90 changed files with 305 additions and 267 deletions.
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/defaults/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type AccountContract, type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type CompleteAddress } from '@aztec/circuit-types';
import { type NodeInfo } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type NodeInfo } from '@aztec/types/interfaces';

import { DefaultAccountInterface } from '../defaults/account_interface.js';

Expand Down
3 changes: 1 addition & 2 deletions yarn-project/accounts/src/defaults/account_interface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type EntrypointInterface, type ExecutionRequestInit } from '@aztec/aztec.js/entrypoint';
import { type AuthWitness, type TxExecutionRequest } from '@aztec/circuit-types';
import { type AztecAddress, type CompleteAddress, Fr } from '@aztec/circuits.js';
import { type AztecAddress, type CompleteAddress, Fr, type NodeInfo } from '@aztec/circuits.js';
import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
import { type NodeInfo } from '@aztec/types/interfaces';

/**
* Default implementation for an account interface. Requires that the account uses the default
Expand Down
14 changes: 6 additions & 8 deletions yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@ import {
type UnencryptedL2Log,
} from '@aztec/circuit-types';
import {
type ContractClassPublic,
ContractClassRegisteredEvent,
type ContractDataSource,
ContractInstanceDeployedEvent,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type FunctionSelector,
type Header,
PrivateFunctionBroadcastedEvent,
type PublicFunction,
UnconstrainedFunctionBroadcastedEvent,
type UnconstrainedFunctionWithMembershipProof,
isValidPrivateFunctionMembershipProof,
isValidUnconstrainedFunctionMembershipProof,
} from '@aztec/circuits.js';
Expand All @@ -37,14 +43,6 @@ import { Timer } from '@aztec/foundation/timer';
import { InboxAbi, RollupAbi } from '@aztec/l1-artifacts';
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
import { type TelemetryClient } from '@aztec/telemetry-client';
import {
type ContractClassPublic,
type ContractDataSource,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type PublicFunction,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';

import groupBy from 'lodash.groupby';
import {
Expand Down
9 changes: 5 additions & 4 deletions yarn-project/archiver/src/archiver/archiver_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ import {
type TxHash,
type TxReceipt,
} from '@aztec/circuit-types';
import { type Fr, type Header } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import {
type ContractClassPublic,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type Fr,
type Header,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';
} from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type AztecAddress } from '@aztec/foundation/aztec-address';

import { type DataRetrieval } from './structs/data_retrieval.js';
import { type L1Published } from './structs/published.js';
Expand Down
15 changes: 9 additions & 6 deletions yarn-project/archiver/src/archiver/archiver_store_test_suite.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { InboxLeaf, L2Block, LogId, LogType, TxHash } from '@aztec/circuit-types';
import '@aztec/circuit-types/jest';
import { AztecAddress, Fr, INITIAL_L2_BLOCK_NUM, L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/circuits.js';
import {
AztecAddress,
type ContractClassPublic,
type ContractInstanceWithAddress,
Fr,
INITIAL_L2_BLOCK_NUM,
L1_TO_L2_MSG_SUBTREE_HEIGHT,
SerializableContractInstance,
} from '@aztec/circuits.js';
import {
makeContractClassPublic,
makeExecutablePrivateFunctionWithMembershipProof,
makeUnconstrainedFunctionWithMembershipProof,
} from '@aztec/circuits.js/testing';
import { times } from '@aztec/foundation/collection';
import { randomBytes, randomInt } from '@aztec/foundation/crypto';
import {
type ContractClassPublic,
type ContractInstanceWithAddress,
SerializableContractInstance,
} from '@aztec/types/contracts';

import { type ArchiverDataStore, type ArchiverL1SynchPoint } from './archiver_store.js';
import { type L1Published } from './structs/published.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { Fr, FunctionSelector, Vector } from '@aztec/circuits.js';
import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize';
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store';
import {
type ContractClassPublic,
type ContractClassPublicWithBlockNumber,
type ExecutablePrivateFunctionWithMembershipProof,
Fr,
FunctionSelector,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';
Vector,
} from '@aztec/circuits.js';
import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize';
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store';

/**
* LMDB implementation of the ArchiverDataStore interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type AztecAddress } from '@aztec/circuits.js';
import { type AztecAddress, type ContractInstanceWithAddress, SerializableContractInstance } from '@aztec/circuits.js';
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store';
import { type ContractInstanceWithAddress, SerializableContractInstance } from '@aztec/types/contracts';

/**
* LMDB implementation of the ArchiverDataStore interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ import {
type TxHash,
type TxReceipt,
} from '@aztec/circuit-types';
import { type Fr, type Header } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import { createDebugLogger } from '@aztec/foundation/log';
import { type AztecKVStore } from '@aztec/kv-store';
import {
type ContractClassPublic,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type Fr,
type Header,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';
} from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import { createDebugLogger } from '@aztec/foundation/log';
import { type AztecKVStore } from '@aztec/kv-store';

import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_store.js';
import { type DataRetrieval } from '../structs/data_retrieval.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ import {
TxReceipt,
type UnencryptedL2BlockL2Logs,
} from '@aztec/circuit-types';
import { Fr, type Header, INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import {
type ContractClassPublic,
type ContractClassPublicWithBlockNumber,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
Fr,
type Header,
INITIAL_L2_BLOCK_NUM,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';
} from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type AztecAddress } from '@aztec/foundation/aztec-address';

import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_store.js';
import { type DataRetrieval } from '../structs/data_retrieval.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/factory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type ContractClassPublic } from '@aztec/circuits.js';
import { createDebugLogger } from '@aztec/foundation/log';
import { createStore } from '@aztec/kv-store/utils';
import { getCanonicalProtocolContract, protocolContractNames } from '@aztec/protocol-contracts';
import { type TelemetryClient } from '@aztec/telemetry-client';
import { NoopTelemetryClient } from '@aztec/telemetry-client/noop';
import { type ContractClassPublic } from '@aztec/types/contracts';

import { Archiver } from './archiver/archiver.js';
import { type ArchiverConfig } from './archiver/config.js';
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec-node/src/aztec-node/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import {
type WorldStateSynchronizer,
mockTxForRollup,
} from '@aztec/circuit-types';
import { EthAddress, Fr, MaxBlockNumber } from '@aztec/circuits.js';
import { type ContractDataSource, EthAddress, Fr, MaxBlockNumber } from '@aztec/circuits.js';
import { type P2P } from '@aztec/p2p';
import { type GlobalVariableBuilder } from '@aztec/sequencer-client';
import { NoopTelemetryClient } from '@aztec/telemetry-client/noop';
import { type ContractDataSource } from '@aztec/types/contracts';

import { type MockProxy, mock } from 'jest-mock-extended';

Expand Down
10 changes: 4 additions & 6 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import {
} from '@aztec/circuit-types';
import {
type ARCHIVE_HEIGHT,
type ContractClassPublic,
type ContractDataSource,
type ContractInstanceWithAddress,
EthAddress,
Fr,
type Header,
Expand All @@ -43,6 +46,7 @@ import {
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
type NullifierLeafPreimage,
type PUBLIC_DATA_TREE_HEIGHT,
type ProtocolContractAddresses,
type PublicDataTreeLeafPreimage,
} from '@aztec/circuits.js';
import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash';
Expand All @@ -69,12 +73,6 @@ import { GlobalVariableBuilder, SequencerClient } from '@aztec/sequencer-client'
import { PublicProcessorFactory, WASMSimulator, createSimulationProvider } from '@aztec/simulator';
import { type TelemetryClient } from '@aztec/telemetry-client';
import { NoopTelemetryClient } from '@aztec/telemetry-client/noop';
import {
type ContractClassPublic,
type ContractDataSource,
type ContractInstanceWithAddress,
type ProtocolContractAddresses,
} from '@aztec/types/contracts';
import { createValidatorClient } from '@aztec/validator-client';
import { createWorldStateSynchronizer } from '@aztec/world-state';

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/account/contract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type CompleteAddress } from '@aztec/circuit-types';
import { type NodeInfo } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type NodeInfo } from '@aztec/types/interfaces';

import { type AccountInterface, type AuthWitnessProvider } from './interface.js';

Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec.js/src/account_manager/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { CompleteAddress, type PXE } from '@aztec/circuit-types';
import { deriveKeys, getContractInstanceFromDeployParams } from '@aztec/circuits.js';
import { type ContractInstanceWithAddress, deriveKeys, getContractInstanceFromDeployParams } from '@aztec/circuits.js';
import { Fr } from '@aztec/foundation/fields';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';

import { type AccountContract } from '../account/contract.js';
import { type Salt } from '../account/index.js';
Expand Down
10 changes: 7 additions & 3 deletions yarn-project/aztec.js/src/contract/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ import {
type TxReceipt,
type TxSimulationResult,
} from '@aztec/circuit-types';
import { AztecAddress, CompleteAddress, EthAddress } from '@aztec/circuits.js';
import {
AztecAddress,
CompleteAddress,
type ContractInstanceWithAddress,
EthAddress,
type NodeInfo,
} from '@aztec/circuits.js';
import { type L1ContractAddresses } from '@aztec/ethereum';
import { type AbiDecoded, type ContractArtifact, FunctionType } from '@aztec/foundation/abi';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';
import { type NodeInfo } from '@aztec/types/interfaces';

import { type MockProxy, mock } from 'jest-mock-extended';

Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec.js/src/contract/contract_base.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { computePartialAddress } from '@aztec/circuits.js';
import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/circuits.js';
import {
type ContractArtifact,
type ContractNote,
type FieldLayout,
type FunctionArtifact,
FunctionSelector,
} from '@aztec/foundation/abi';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';

import { type Wallet } from '../account/index.js';
import { ContractFunctionInteraction } from './contract_function_interaction.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/contract/deploy_method.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { type FunctionCall, type TxExecutionRequest } from '@aztec/circuit-types';
import {
AztecAddress,
type ContractInstanceWithAddress,
computePartialAddress,
getContractClassFromArtifact,
getContractInstanceFromDeployParams,
} from '@aztec/circuits.js';
import { type ContractArtifact, type FunctionArtifact, getInitializer } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';

import { type Wallet } from '../account/index.js';
import { deployInstance } from '../deployment/deploy_instance.js';
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec.js/src/contract/deploy_proven_tx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type PXE, type Tx } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';
import { type AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js';

import { type Wallet } from '../account/index.js';
import { type Contract } from './contract.js';
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/aztec.js/src/contract/deploy_sent_tx.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type PXE, type TxHash, type TxReceipt } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js';
import { createDebugLogger } from '@aztec/foundation/log';
import { type FieldsOf } from '@aztec/foundation/types';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';

import { type Wallet } from '../account/index.js';
import { type Contract } from './contract.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/contract/unsafe_contract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ContractInstanceWithAddress } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';

import { type Wallet } from '../wallet/index.js';
import { ContractBase } from './contract_base.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/deployment/deploy_instance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ContractInstanceWithAddress } from '@aztec/types/contracts';
import { type ContractInstanceWithAddress } from '@aztec/circuits.js';

import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js';
import { type Wallet } from '../wallet/index.js';
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/aztec.js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export {
Point,
getContractClassFromArtifact,
getContractInstanceFromDeployParams,
ContractClassWithId,
ContractInstanceWithAddress,
NodeInfo,
} from '@aztec/circuits.js';

export { computeSecretHash } from '@aztec/circuits.js/hash';
Expand Down Expand Up @@ -137,9 +140,6 @@ export {
EpochProofQuote,
EpochProofQuotePayload,
} from '@aztec/circuit-types';
export type { NodeInfo } from '@aztec/types/interfaces';

export type { ContractClassWithId, ContractInstanceWithAddress } from '@aztec/types/contracts';

// TODO: These kinds of things have no place on our public api.
// External devs will almost certainly have their own methods of doing these things.
Expand Down
5 changes: 3 additions & 2 deletions yarn-project/aztec.js/src/wallet/base_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import { type NoteProcessorStats } from '@aztec/circuit-types/stats';
import {
type AztecAddress,
type CompleteAddress,
type ContractClassWithId,
type ContractInstanceWithAddress,
type Fr,
type L1_TO_L2_MSG_TREE_HEIGHT,
type NodeInfo,
type PartialAddress,
type Point,
} from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type ContractClassWithId, type ContractInstanceWithAddress } from '@aztec/types/contracts';
import { type NodeInfo } from '@aztec/types/interfaces';

import { type Wallet } from '../account/wallet.js';
import { type ExecutionRequestInit } from '../entrypoint/entrypoint.js';
Expand Down
10 changes: 8 additions & 2 deletions yarn-project/bb-prover/src/avm_proving.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { AvmCircuitInputs, AvmVerificationKeyData, FunctionSelector, Gas, GlobalVariables } from '@aztec/circuits.js';
import {
AvmCircuitInputs,
AvmVerificationKeyData,
FunctionSelector,
Gas,
GlobalVariables,
SerializableContractInstance,
} from '@aztec/circuits.js';
import { Fr } from '@aztec/foundation/fields';
import { createDebugLogger } from '@aztec/foundation/log';
import { AvmSimulator, PublicSideEffectTrace, type WorldStateDB } from '@aztec/simulator';
Expand All @@ -9,7 +16,6 @@ import {
initPersistableStateManager,
resolveAvmTestContractAssertionMessage,
} from '@aztec/simulator/avm/fixtures';
import { SerializableContractInstance } from '@aztec/types/contracts';

import { jest } from '@jest/globals';
import { mock } from 'jest-mock-extended';
Expand Down
Loading

0 comments on commit b1d4492

Please sign in to comment.