Skip to content

Commit

Permalink
fix: patch merge, and add enums to event parser
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Aug 10, 2023
1 parent 0f2f9c8 commit 00f8073
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/contract/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ export class Contract implements ContractInterface {
[]
) || [],
this.events,
this.structs
this.structs,
CallData.getAbiEnum(this.abi)
);
}

Expand Down
1 change: 0 additions & 1 deletion src/types/contract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CairoEnum } from './cairoEnum';

import {
BigNumberish,
BlockIdentifier,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/calldata/responseParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Args,
BigNumberish,
CairoEnum,
EventEntry
EventEntry,
ParsedStruct,
} from '../../types';
import { uint256ToBN } from '../uint256';
Expand Down
6 changes: 5 additions & 1 deletion src/utils/events/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
Abi,
AbiEnums,
AbiEvents,
AbiStructs,
Cairo1Event,
Expand Down Expand Up @@ -37,7 +38,8 @@ export function getAbiEvents(abi: Abi): AbiEvents {
export function parseEvents(
providerReceivedEvents: Array<ProviderEvent>,
abiEvents: AbiEvents,
abiStructs: AbiStructs
abiStructs: AbiStructs,
abiEnums: AbiEnums
): ParsedEvents {
const ret = providerReceivedEvents.flat().reduce((acc, recEvent) => {
const abiEvent: EventAbi = abiEvents[recEvent.keys[0]];
Expand Down Expand Up @@ -66,6 +68,7 @@ export function parseEvents(
keysIter,
key,
abiStructs,
abiEnums,
parsedEvent[abiEvent.name]
);
});
Expand All @@ -75,6 +78,7 @@ export function parseEvents(
dataIter,
data,
abiStructs,
abiEnums,
parsedEvent[abiEvent.name]
);
});
Expand Down

0 comments on commit 00f8073

Please sign in to comment.