Skip to content

Commit c9b20be

Browse files
committed
fix: use index instead of portalOptionId
1 parent 6f7a848 commit c9b20be

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

src/mappings/diamond.ts

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,29 +2048,18 @@ export function handlePortalData(event: PortalData): void {
20482048
// Handle portal options
20492049
let options = data.options;
20502050

2051-
// Log the options array for debugging
2052-
log.info("PortalData - Portal ID: {}, Options length: {}", [
2053-
portal.id,
2054-
options.length.toString(),
2055-
]);
2056-
2057-
if (options != null && options.length > 0) {
2058-
for (let i = 0; i < options.length; i++) {
2059-
let option = getOrCreateAavegotchiOption(
2060-
portal.id,
2061-
options[i].portalOptionId
2062-
);
2063-
option.portal = portal.id;
2064-
option.owner = portal.owner;
2065-
option.portalOptionId = options[i].portalOptionId;
2066-
option.randomNumber = options[i].randomNumber;
2067-
option.numericTraits = options[i].numericTraits;
2068-
option.collateralType = options[i].collateralType;
2069-
option.minimumStake = options[i].minimumStake;
2070-
option.baseRarityScore = options[i].baseRarityScore;
2071-
2072-
option.save();
2073-
}
2051+
for (let i = 0; i < options.length; i++) {
2052+
let option = getOrCreateAavegotchiOption(portal.id, i);
2053+
option.portal = portal.id;
2054+
option.owner = portal.owner;
2055+
option.portalOptionId = options[i].portalOptionId;
2056+
option.randomNumber = options[i].randomNumber;
2057+
option.numericTraits = options[i].numericTraits;
2058+
option.collateralType = options[i].collateralType;
2059+
option.minimumStake = options[i].minimumStake;
2060+
option.baseRarityScore = options[i].baseRarityScore;
2061+
2062+
option.save();
20742063
}
20752064

20762065
portal.save();

0 commit comments

Comments
 (0)