Skip to content

Commit

Permalink
explicit type imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlielye committed Apr 1, 2024
1 parent 08b02a5 commit f06d255
Show file tree
Hide file tree
Showing 592 changed files with 2,493 additions and 2,235 deletions.
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/defaults/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AccountContract, AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
import { CompleteAddress } from '@aztec/circuit-types';
import { ContractArtifact } from '@aztec/foundation/abi';
import { NodeInfo } from '@aztec/types/interfaces';
import { type AccountContract, type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type CompleteAddress } from '@aztec/circuit-types';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type NodeInfo } from '@aztec/types/interfaces';

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

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

/**
* Default implementation for an account interface. Requires that the account uses the default
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/ecdsa/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress } from '@aztec/circuit-types';
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, type CompleteAddress } from '@aztec/circuit-types';
import { Ecdsa } from '@aztec/circuits.js/barretenberg';
import { ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.js';
import { EcdsaAccountContractArtifact } from './artifact.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/ecdsa/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';
import { type NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';

import EcdsaAccountContractJson from '../artifacts/EcdsaAccount.json' assert { type: 'json' };

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/ecdsa/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*
* @packageDocumentation
*/
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';

import { EcdsaAccountContract } from './account_contract.js';

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/schnorr/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress, GrumpkinPrivateKey } from '@aztec/circuit-types';
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, type CompleteAddress, type GrumpkinPrivateKey } from '@aztec/circuit-types';
import { Schnorr } from '@aztec/circuits.js/barretenberg';
import { ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.js';
import { SchnorrAccountContractArtifact } from './artifact.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/schnorr/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';
import { type NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';

import SchnorrAccountContractJson from '../artifacts/SchnorrAccount.json' assert { type: 'json' };

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/schnorr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*
* @packageDocumentation
*/
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';

import { SchnorrAccountContract } from './account_contract.js';

Expand Down
10 changes: 5 additions & 5 deletions yarn-project/accounts/src/single_key/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { generatePublicKey } from '@aztec/aztec.js';
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress, GrumpkinPrivateKey } from '@aztec/circuit-types';
import { PartialAddress } from '@aztec/circuits.js';
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, type CompleteAddress, type GrumpkinPrivateKey } from '@aztec/circuit-types';
import { type PartialAddress } from '@aztec/circuits.js';
import { Schnorr } from '@aztec/circuits.js/barretenberg';
import { ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { type Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.js';
import { SchnorrSingleKeyAccountContractArtifact } from './artifact.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/accounts/src/single_key/artifact.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';
import { type NoirCompiledContract, loadContractArtifact } from '@aztec/aztec.js';

import SchnorrSingleKeyAccountContractJson from '../artifacts/SchnorrSingleKeyAccount.json' assert { type: 'json' };

Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/single_key/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*
* @packageDocumentation
*/
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';

import { SingleKeyAccountContract } from './account_contract.js';

Expand Down
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/testing/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { generatePublicKey } from '@aztec/aztec.js';
import { AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { PXE } from '@aztec/circuit-types';
import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';

import { getSchnorrAccount } from '../schnorr/index.js';
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/testing/create_account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { PXE } from '@aztec/circuit-types';
import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { GrumpkinScalar } from '@aztec/circuits.js';

import { getSchnorrAccount } from '../schnorr/index.js';
Expand Down
20 changes: 14 additions & 6 deletions yarn-project/archiver/src/archiver/archiver.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import { Body, EncryptedL2BlockL2Logs, L2Block, LogType, UnencryptedL2BlockL2Logs } from '@aztec/circuit-types';
import { type Body, EncryptedL2BlockL2Logs, L2Block, LogType, UnencryptedL2BlockL2Logs } from '@aztec/circuit-types';
import { EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { sleep } from '@aztec/foundation/sleep';
import { AvailabilityOracleAbi, InboxAbi, RollupAbi } from '@aztec/l1-artifacts';

import { MockProxy, mock } from 'jest-mock-extended';
import { Chain, HttpTransport, Log, PublicClient, Transaction, encodeFunctionData, toHex } from 'viem';
import { AvailabilityOracleAbi, type InboxAbi, RollupAbi } from '@aztec/l1-artifacts';

import { type MockProxy, mock } from 'jest-mock-extended';
import {
type Chain,
type HttpTransport,
type Log,
type PublicClient,
type Transaction,
encodeFunctionData,
toHex,
} from 'viem';

import { Archiver } from './archiver.js';
import { ArchiverDataStore } from './archiver_store.js';
import { type ArchiverDataStore } from './archiver_store.js';
import { MemoryArchiverStore } from './memory_archiver_store/memory_archiver_store.js';

describe('Archiver', () => {
Expand Down
52 changes: 26 additions & 26 deletions yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {
FromLogType,
GetUnencryptedLogsResponse,
L1ToL2MessageSource,
type FromLogType,
type GetUnencryptedLogsResponse,
type L1ToL2MessageSource,
L2Block,
L2BlockL2Logs,
L2BlockSource,
L2LogsSource,
LogFilter,
LogType,
TxEffect,
TxHash,
TxReceipt,
UnencryptedL2Log,
type L2BlockL2Logs,
type L2BlockSource,
type L2LogsSource,
type LogFilter,
type LogType,
type TxEffect,
type TxHash,
type TxReceipt,
type UnencryptedL2Log,
} from '@aztec/circuit-types';
import { ContractClassRegisteredEvent, FunctionSelector } from '@aztec/circuits.js';
import { ContractClassRegisteredEvent, type FunctionSelector } from '@aztec/circuits.js';
import {
ContractInstanceDeployedEvent,
PrivateFunctionBroadcastedEvent,
Expand All @@ -22,28 +22,28 @@ import {
isValidUnconstrainedFunctionMembershipProof,
} from '@aztec/circuits.js/contract';
import { createEthereumChain } from '@aztec/ethereum';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { EthAddress } from '@aztec/foundation/eth-address';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import { type EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { RunningPromise } from '@aztec/foundation/running-promise';
import { getCanonicalClassRegistererAddress } from '@aztec/protocol-contracts/class-registerer';
import {
ContractClassPublic,
ContractDataSource,
ContractInstanceWithAddress,
ExecutablePrivateFunctionWithMembershipProof,
PublicFunction,
UnconstrainedFunctionWithMembershipProof,
type ContractClassPublic,
type ContractDataSource,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type PublicFunction,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';

import groupBy from 'lodash.groupby';
import { Chain, HttpTransport, PublicClient, createPublicClient, http } from 'viem';
import { type Chain, type HttpTransport, type PublicClient, createPublicClient, http } from 'viem';

import { ArchiverDataStore } from './archiver_store.js';
import { ArchiverConfig } from './config.js';
import { type ArchiverDataStore } from './archiver_store.js';
import { type ArchiverConfig } from './config.js';
import {
DataRetrieval,
type DataRetrieval,
retrieveBlockBodiesFromAvailabilityOracle,
retrieveBlockMetadataFromRollup,
retrieveL1ToL2Messages,
Expand Down
40 changes: 20 additions & 20 deletions yarn-project/archiver/src/archiver/archiver_store.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import {
Body,
EncryptedL2BlockL2Logs,
FromLogType,
GetUnencryptedLogsResponse,
InboxLeaf,
L2Block,
L2BlockL2Logs,
LogFilter,
LogType,
TxEffect,
TxHash,
TxReceipt,
UnencryptedL2BlockL2Logs,
type Body,
type EncryptedL2BlockL2Logs,
type FromLogType,
type GetUnencryptedLogsResponse,
type InboxLeaf,
type L2Block,
type L2BlockL2Logs,
type LogFilter,
type LogType,
type TxEffect,
type TxHash,
type TxReceipt,
type UnencryptedL2BlockL2Logs,
} from '@aztec/circuit-types';
import { Fr } from '@aztec/circuits.js';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { type Fr } from '@aztec/circuits.js';
import { type AztecAddress } from '@aztec/foundation/aztec-address';
import {
ContractClassPublic,
ContractInstanceWithAddress,
ExecutablePrivateFunctionWithMembershipProof,
UnconstrainedFunctionWithMembershipProof,
type ContractClassPublic,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';

import { DataRetrieval } from './data_retrieval.js';
import { type DataRetrieval } from './data_retrieval.js';

/**
* Represents the latest L1 block processed by the archiver for various objects in L2.
Expand Down
10 changes: 7 additions & 3 deletions yarn-project/archiver/src/archiver/archiver_store_test_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ import {
} from '@aztec/circuits.js/testing';
import { times } from '@aztec/foundation/collection';
import { randomBytes, randomInt } from '@aztec/foundation/crypto';
import { ContractClassPublic, ContractInstanceWithAddress, SerializableContractInstance } from '@aztec/types/contracts';
import {
type ContractClassPublic,
type ContractInstanceWithAddress,
SerializableContractInstance,
} from '@aztec/types/contracts';

import { ArchiverDataStore } from './archiver_store.js';
import { DataRetrieval } from './data_retrieval.js';
import { type ArchiverDataStore } from './archiver_store.js';
import { type DataRetrieval } from './data_retrieval.js';

/**
* @param testName - The name of the test suite.
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { L1ContractAddresses } from '@aztec/ethereum';
import { type L1ContractAddresses } from '@aztec/ethereum';
import { EthAddress } from '@aztec/foundation/eth-address';

/**
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/archiver/src/archiver/data_retrieval.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Body, InboxLeaf } from '@aztec/circuit-types';
import { AppendOnlyTreeSnapshot, Header } from '@aztec/circuits.js';
import { EthAddress } from '@aztec/foundation/eth-address';
import { type Body, type InboxLeaf } from '@aztec/circuit-types';
import { type AppendOnlyTreeSnapshot, type Header } from '@aztec/circuits.js';
import { type EthAddress } from '@aztec/foundation/eth-address';

import { PublicClient } from 'viem';
import { type PublicClient } from 'viem';

import {
getL2BlockProcessedLogs,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/archiver/src/archiver/eth_log_handlers.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Body, InboxLeaf } from '@aztec/circuit-types';
import { AppendOnlyTreeSnapshot, Header } from '@aztec/circuits.js';
import { EthAddress } from '@aztec/foundation/eth-address';
import { type EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { numToUInt32BE } from '@aztec/foundation/serialize';
import { AvailabilityOracleAbi, InboxAbi, RollupAbi } from '@aztec/l1-artifacts';

import { Hex, Log, PublicClient, decodeFunctionData, getAbiItem, getAddress, hexToBytes } from 'viem';
import { type Hex, type Log, type PublicClient, decodeFunctionData, getAbiItem, getAddress, hexToBytes } from 'viem';

/**
* Processes newly received MessageSent (L1 to L2) logs.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Body } from '@aztec/circuit-types';
import { AztecKVStore, AztecMap } from '@aztec/kv-store';
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store';

export class BlockBodyStore {
/** Map block body hash to block body */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { L2Block, TxEffect, TxHash, TxReceipt, TxStatus } from '@aztec/circuit-types';
import { AppendOnlyTreeSnapshot, AztecAddress, Header, INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js';
import { L2Block, type TxEffect, type TxHash, TxReceipt, TxStatus } from '@aztec/circuit-types';
import { AppendOnlyTreeSnapshot, type AztecAddress, Header, INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js';
import { createDebugLogger } from '@aztec/foundation/log';
import { AztecKVStore, AztecMap, AztecSingleton, Range } from '@aztec/kv-store';
import { type AztecKVStore, type AztecMap, type AztecSingleton, type Range } from '@aztec/kv-store';

import { DataRetrieval } from '../data_retrieval.js';
import { BlockBodyStore } from './block_body_store.js';
import { type DataRetrieval } from '../data_retrieval.js';
import { type BlockBodyStore } from './block_body_store.js';

type BlockIndexValue = [blockNumber: number, index: number];

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

/**
Expand Down
Loading

0 comments on commit f06d255

Please sign in to comment.