Skip to content

Commit

Permalink
chore: explicit type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
charlielye committed Mar 30, 2024
1 parent 871c44c commit 8277f73
Show file tree
Hide file tree
Showing 535 changed files with 1,659 additions and 1,472 deletions.
6 changes: 3 additions & 3 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 { type AccountContract, type AccountInterface, type 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 ContractArtifact } from '@aztec/foundation/abi';
import { type NodeInfo } from '@aztec/types/interfaces';

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

Expand Down
8 changes: 4 additions & 4 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 { type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type EntrypointInterface, type FeeOptions } from '@aztec/aztec.js/entrypoint';
import { AuthWitness, type FunctionCall, TxExecutionRequest } from '@aztec/circuit-types';
import { AztecAddress, 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
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/ecdsa/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { AuthWitness, CompleteAddress } from '@aztec/circuit-types';
import { Ecdsa } from '@aztec/circuits.js/barretenberg';
import { ContractArtifact } from '@aztec/foundation/abi';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.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
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/ecdsa/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*
* @packageDocumentation
*/
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';

import { EcdsaAccountContract } from './account_contract.js';
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/accounts/src/schnorr/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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, CompleteAddress, type GrumpkinPrivateKey } from '@aztec/circuit-types';
import { Schnorr } from '@aztec/circuits.js/barretenberg';
import { ContractArtifact } from '@aztec/foundation/abi';
import { type ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.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
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/schnorr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*
* @packageDocumentation
*/
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';

import { SchnorrAccountContract } from './account_contract.js';
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/accounts/src/single_key/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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, 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 { type ContractArtifact } from '@aztec/foundation/abi';
import { Fr } from '@aztec/foundation/fields';

import { DefaultAccountContract } from '../defaults/account_contract.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
4 changes: 2 additions & 2 deletions yarn-project/accounts/src/single_key/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*
* @packageDocumentation
*/
import { AccountManager, Salt } from '@aztec/aztec.js/account';
import { AccountManager, type Salt } from '@aztec/aztec.js/account';
import { AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { GrumpkinPrivateKey, PXE } from '@aztec/circuit-types';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { AztecAddress } from '@aztec/circuits.js';

import { SingleKeyAccountContract } from './account_contract.js';
Expand Down
2 changes: 1 addition & 1 deletion 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 PXE } from '@aztec/circuit-types';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';

import { getSchnorrAccount } from '../schnorr/index.js';
Expand Down
2 changes: 1 addition & 1 deletion 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 PXE } from '@aztec/circuit-types';
import { GrumpkinScalar } from '@aztec/circuits.js';

import { getSchnorrAccount } from '../schnorr/index.js';
Expand Down
14 changes: 11 additions & 3 deletions yarn-project/archiver/src/archiver/archiver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ 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 { 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
34 changes: 17 additions & 17 deletions yarn-project/archiver/src/archiver/archiver.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
FromLogType,
GetUnencryptedLogsResponse,
L1ToL2MessageSource,
type FromLogType,
type GetUnencryptedLogsResponse,
type L1ToL2MessageSource,
L2Block,
L2BlockL2Logs,
L2BlockSource,
L2LogsSource,
LogFilter,
type L2BlockSource,
type L2LogsSource,
type LogFilter,
LogType,
TxEffect,
TxHash,
Expand All @@ -25,25 +25,25 @@ import { createEthereumChain } from '@aztec/ethereum';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { 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
16 changes: 8 additions & 8 deletions yarn-project/archiver/src/archiver/archiver_store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
Body,
EncryptedL2BlockL2Logs,
FromLogType,
GetUnencryptedLogsResponse,
type FromLogType,
type GetUnencryptedLogsResponse,
InboxLeaf,
L2Block,
L2BlockL2Logs,
LogFilter,
type LogFilter,
LogType,
TxEffect,
TxHash,
Expand All @@ -16,13 +16,13 @@ import {
import { Fr } from '@aztec/circuits.js';
import { 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
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/data_retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Body, InboxLeaf } from '@aztec/circuit-types';
import { AppendOnlyTreeSnapshot, Header } from '@aztec/circuits.js';
import { EthAddress } from '@aztec/foundation/eth-address';

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

import {
getL2BlockProcessedLogs,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/eth_log_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './archiver.js';
export * from './config.js';
export { MemoryArchiverStore } from './memory_archiver_store/memory_archiver_store.js';
export { ArchiverDataStore } from './archiver_store.js';
export { type ArchiverDataStore } from './archiver_store.js';
export { KVArchiverDataStore } from './kv_archiver_store/kv_archiver_store.js';
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,9 +1,9 @@
import { L2Block, TxEffect, TxHash, TxReceipt, TxStatus } from '@aztec/circuit-types';
import { AppendOnlyTreeSnapshot, 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 { type DataRetrieval } from '../data_retrieval.js';
import { 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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AztecAddress } from '@aztec/circuits.js';
import { AztecKVStore, AztecMap } from '@aztec/kv-store';
import { ContractInstanceWithAddress, SerializableContractInstance } from '@aztec/types/contracts';
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
@@ -1,12 +1,12 @@
import {
Body,
EncryptedL2BlockL2Logs,
FromLogType,
GetUnencryptedLogsResponse,
type FromLogType,
type GetUnencryptedLogsResponse,
InboxLeaf,
L2Block,
L2BlockL2Logs,
LogFilter,
type LogFilter,
LogType,
TxEffect,
TxHash,
Expand All @@ -16,16 +16,16 @@ import {
import { Fr } from '@aztec/circuits.js';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { createDebugLogger } from '@aztec/foundation/log';
import { AztecKVStore } from '@aztec/kv-store';
import { type AztecKVStore } from '@aztec/kv-store';
import {
ContractClassPublic,
ContractInstanceWithAddress,
ExecutablePrivateFunctionWithMembershipProof,
UnconstrainedFunctionWithMembershipProof,
type ContractClassPublic,
type ContractInstanceWithAddress,
type ExecutablePrivateFunctionWithMembershipProof,
type UnconstrainedFunctionWithMembershipProof,
} from '@aztec/types/contracts';

import { ArchiverDataStore, ArchiverL1SynchPoint } from '../archiver_store.js';
import { DataRetrieval } from '../data_retrieval.js';
import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_store.js';
import { type DataRetrieval } from '../data_retrieval.js';
import { BlockBodyStore } from './block_body_store.js';
import { BlockStore } from './block_store.js';
import { ContractClassStore } from './contract_class_store.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {
EncryptedL2BlockL2Logs,
ExtendedUnencryptedL2Log,
FromLogType,
GetUnencryptedLogsResponse,
type FromLogType,
type GetUnencryptedLogsResponse,
L2BlockL2Logs,
LogFilter,
type LogFilter,
LogId,
LogType,
UnencryptedL2BlockL2Logs,
UnencryptedL2Log,
} from '@aztec/circuit-types';
import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants';
import { createDebugLogger } from '@aztec/foundation/log';
import { AztecKVStore, AztecMap } from '@aztec/kv-store';
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store';

import { BlockStore } from './block_store.js';

Expand Down

0 comments on commit 8277f73

Please sign in to comment.