Skip to content

Commit

Permalink
fix default admin address
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-rosianu committed Feb 16, 2024
1 parent eae542a commit a13fe81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 2 additions & 8 deletions action/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -188090,9 +188090,7 @@ const robot = (app) => {
});
const publicKey = new out_2.UserPublicKey(new out_1.Address(address).pubkey());
const verifier = new out_2.UserVerifier(publicKey);
const result = verifier.verify(signableMessage.serializeForSigning(), Buffer.from(signature, 'hex'));
console.info(`Verification result for address '${address}', message '${message}', signature '${signature}' is ${result}`);
return result;
return verifier.verify(signableMessage.serializeForSigning(), Buffer.from(signature, 'hex'));
}
async function multiVerify(bodies, addresses, messages) {
if (addresses.length === 0) {
Expand Down Expand Up @@ -188148,11 +188146,7 @@ const robot = (app) => {
});
const body = pullRequest.body || '';
const bodies = [...comments.data.map(x => x.body || ''), body];
let adminAddress = process.env.ADMIN_ADDRESS;
if (!adminAddress) {
adminAddress = 'erd1cevsw7mq5uvqymjqzwqvpqtdrhckehwfz99n7praty3y7q2j7yps842mqh';
}
console.info({ adminAddress });
const adminAddress = process.env.ADMIN_ADDRESS;
if (adminAddress) {
const invalidAddresses = await multiVerify(bodies, [adminAddress], commitShas);
if (invalidAddresses && invalidAddresses.length === 0) {
Expand Down
5 changes: 1 addition & 4 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ export const robot = (app: Probot) => {

const bodies = [...comments.data.map(x => x.body || ''), body];

let adminAddress = process.env.ADMIN_ADDRESS;
if (!adminAddress) {
adminAddress = 'erd1cevsw7mq5uvqymjqzwqvpqtdrhckehwfz99n7praty3y7q2j7yps842mqh';
}
const adminAddress = process.env.ADMIN_ADDRESS;

if (adminAddress) {
const invalidAddresses = await multiVerify(bodies, [adminAddress], commitShas);
Expand Down

0 comments on commit a13fe81

Please sign in to comment.