Skip to content

Commit

Permalink
fix verifyGenesisLegionHolders handler (#3)
Browse files Browse the repository at this point in the history
* add debug statement

* parse handler body

* normalize wallet inputs
  • Loading branch information
alecananian authored Mar 7, 2024
1 parent 91ea899 commit e1dabee
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/handlers/bridgeworld.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ exports.getMines = getMines;
exports.getLegionHolders = getLegionHolders;

exports.verifyGenesisLegionHolders = async (event) => {
console.log(event, event?.body, event?.body?.wallet);
const wallets = event?.body?.wallets
? event.body.wallets
: event?.body?.wallet
? [event.body.wallet]
: [];
const body = JSON.parse(event.body);
const wallets = (body.wallets || body.wallet || []).map((wallet) =>
wallet.toLowerCase()
);
console.log("Querying Genesis Legion holder status for wallets:", wallets);
return {
success: await hasGenesisLegion(wallets),
};
Expand Down

0 comments on commit e1dabee

Please sign in to comment.