Skip to content

Commit

Permalink
fix: challenge event parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ps1dr3x committed Oct 6, 2023
1 parent 5306783 commit d3bbd34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/challenge.ts
Expand Up @@ -51,7 +51,7 @@ export const challenge = async (

const receiptTx = await challengeTx.wait();

const parsedPayload = parseChallenge(receiptTx);
const parsedPayload = parseChallenge(receiptTx.logs);

callbacks && callbacks.confirmed && callbacks.confirmed(parsedPayload);

Expand Down
11 changes: 3 additions & 8 deletions src/core/internal/parsers/eventChallenge.ts
@@ -1,14 +1,9 @@
import { ChallengeParsedPayload } from "../../../typing";
import {
ADDRESS_ZERO,
bipsToPercentage,
nullOrValue,
toDate,
} from "../../../helpers";
import { bipsToPercentage, nullOrValue, toDate } from "../../../helpers";
import { getEventByName } from "./common";

export const parseChallenge = (tx: any): ChallengeParsedPayload => {
const _event = getEventByName("Challenge", tx.events);
export const parseChallenge = (events: any): ChallengeParsedPayload => {
const _event = getEventByName("Challenge", events);

const [escrow_id, challenged_at, escrow] = _event.args;

Expand Down

0 comments on commit d3bbd34

Please sign in to comment.