From 6a450f6f9ddc9c40d533fa50ee1c81f15f87472f Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 11 Oct 2023 14:56:15 +0000 Subject: [PATCH] updated docs and comments --- yarn-project/archiver/src/archiver/archiver_store.ts | 2 +- yarn-project/cli/README.md | 3 ++- yarn-project/cli/src/index.ts | 2 +- yarn-project/types/src/logs/log_filter.ts | 6 ++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/yarn-project/archiver/src/archiver/archiver_store.ts b/yarn-project/archiver/src/archiver/archiver_store.ts index 75fd80cd961d..3b6d907a410d 100644 --- a/yarn-project/archiver/src/archiver/archiver_store.ts +++ b/yarn-project/archiver/src/archiver/archiver_store.ts @@ -369,7 +369,7 @@ export class MemoryArchiverStore implements ArchiverDataStore { * Gets unencrypted logs based on the provided filter. * @param filter - The filter to apply to the logs. * @returns The requested logs. - * @throws If filter is invalid. + * @remarks Works by doing an intersection of all params in the filter. */ getUnencryptedLogs(filter: LogFilter): Promise { let txHash: TxHash | undefined; diff --git a/yarn-project/cli/README.md b/yarn-project/cli/README.md index aa5aec84b792..70007f28da5d 100644 --- a/yarn-project/cli/README.md +++ b/yarn-project/cli/README.md @@ -387,7 +387,8 @@ aztec-cli parse-parameter-struct 0xabcdef1234567890abcdef1234567890abcdef1234567 ### get-logs -Gets all the unencrypted logs from L2 blocks in the specified range. +Applies filter and returns the resulting unencrypted logs. +The filter is applied by doing an intersection of all its params. Syntax: diff --git a/yarn-project/cli/src/index.ts b/yarn-project/cli/src/index.ts index dc2ad86e6633..ad73a3544770 100644 --- a/yarn-project/cli/src/index.ts +++ b/yarn-project/cli/src/index.ts @@ -283,7 +283,7 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command { program .command('get-logs') - .description('Gets all the unencrypted logs from L2 blocks in the range specified.') + .description('Gets all the unencrypted logs from an intersection of all the filter params.') .option('-tx, --tx-hash ', 'A transaction hash to get the receipt for.', parseOptionalTxHash) .option( '-fb, --from-block ', diff --git a/yarn-project/types/src/logs/log_filter.ts b/yarn-project/types/src/logs/log_filter.ts index 3dd0c223a23d..34dca97343ef 100644 --- a/yarn-project/types/src/logs/log_filter.ts +++ b/yarn-project/types/src/logs/log_filter.ts @@ -4,23 +4,21 @@ import { LogId, TxHash } from '../index.js'; /** * Log filter used to fetch L2 logs. + * @remarks This filter is applied as an intersection of all it's params. */ export type LogFilter = { /** * Hash of a transaction from which to fetch the logs. - * @remarks If this is set, `fromBlock` and `toBlock` can't be defined. */ txHash?: TxHash; /** * The block number from which to start fetching logs (inclusive). - * @remarks If this is set, `txHash` can't be defined. */ fromBlock?: number; /** The block number until which to fetch logs (not inclusive). */ toBlock?: number; /** - * Log id after which to start fetching logs . - * @remarks This is a continuation parameter and when it is set, txHash and fromBlock and toBlock are ignored. + * Log id after which to start fetching logs. */ afterLog?: LogId; /** The contract address to filter logs by. */