Skip to content

Commit

Permalink
fix(scrt::add_validator): check for emitted event in add validator
Browse files Browse the repository at this point in the history
  • Loading branch information
imsk17 committed Oct 28, 2024
1 parent 6f90519 commit c67e90a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/handler/secrets/utils/addSelfAsValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,21 @@ export default async function addSelfAsValidator(
sender: pubkeyToAddress(Buffer.from(wallet.publicKey)),
},
{
gasLimit: 200_000,
gasLimit: 250_000,
},
),
);
logger.info(
`Added self as chain at hash: ${add.transactionHash}. TX:`,
`Submitted tx to add self as validator at hash: ${
add.transactionHash
}. Status: ${
add.rawLog.includes("AddNewValidatorEventInfo") ? "success" : "failure"
}. TX:`,
add,
);
return "success";
return add.rawLog.includes("AddNewValidatorEventInfo")
? "success"
: "failure";
} catch (e) {
logger.error("Failed to add self as validator: ", e);
return "failure";
Expand Down

0 comments on commit c67e90a

Please sign in to comment.