Skip to content

Commit e1dabee

Browse files
authored
fix verifyGenesisLegionHolders handler (#3)
* add debug statement * parse handler body * normalize wallet inputs
1 parent 91ea899 commit e1dabee

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/handlers/bridgeworld.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ exports.getMines = getMines;
1212
exports.getLegionHolders = getLegionHolders;
1313

1414
exports.verifyGenesisLegionHolders = async (event) => {
15-
console.log(event, event?.body, event?.body?.wallet);
16-
const wallets = event?.body?.wallets
17-
? event.body.wallets
18-
: event?.body?.wallet
19-
? [event.body.wallet]
20-
: [];
15+
const body = JSON.parse(event.body);
16+
const wallets = (body.wallets || body.wallet || []).map((wallet) =>
17+
wallet.toLowerCase()
18+
);
19+
console.log("Querying Genesis Legion holder status for wallets:", wallets);
2120
return {
2221
success: await hasGenesisLegion(wallets),
2322
};

0 commit comments

Comments
 (0)