File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { AbiType } from './abi.js' ;
22import type { EventSelector } from './event_selector.js' ;
33
4+ /** Metadata for a contract event, used to decode emitted event logs back into structured data. */
45export type EventMetadataDefinition = {
56 eventSelector : EventSelector ;
67 abiType : AbiType ;
8+ /** Names of the event's struct members (not serialized Noir Field elements). */
79 fieldNames : string [ ] ;
810} ;
Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ export class FlatPublicLogs {
120120
121121export class PublicLog {
122122 constructor (
123- public contractAddress : AztecAddress ,
124- public fields : Fr [ ] ,
123+ public readonly contractAddress : AztecAddress ,
124+ public readonly fields : Fr [ ] ,
125125 ) { }
126126
127127 static from ( fields : FieldsOf < PublicLog > ) {
@@ -146,7 +146,9 @@ export class PublicLog {
146146 return this . fields . length + PUBLIC_LOG_HEADER_LENGTH ;
147147 }
148148
149+ /** Returns the serialized log (field as in noir field and not a struct field). */
149150 getEmittedFields ( ) {
151+ // We slice from 0 to return a shallow copy.
150152 return this . fields . slice ( 0 ) ;
151153 }
152154
You can’t perform that action at this time.
0 commit comments