Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reading cairo 1.0 input specs #359

Merged
merged 2 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/starknet-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export interface CairoFunction {
}

export interface EventSpecification {
data: Argument[];
data?: Argument[];
inputs?: Argument[];
keys: string[];
name: string;
type: "event";
Expand Down
3 changes: 2 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@ export class StarknetContract {
throw new StarknetPluginError(msg);
}

const adapted = adaptOutputUtil(rawEventData, eventSpecification.data, this.abi);
const inputSpecs = this.isCairo1 ? eventSpecification.inputs : eventSpecification.data;
const adapted = adaptOutputUtil(rawEventData, inputSpecs, this.abi);
decodedEvents.push({ name: eventSpecification.name, data: adapted });
}

Expand Down