Skip to content

Commit 2b386c9

Browse files
committed
if rabbit claims AS uses references it could be right :D
Signed-off-by: stadolf <[email protected]>
1 parent bd86bfe commit 2b386c9

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

subgraph/src/ipnftMapping.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,17 @@ export function handleReservation(event: ReservedEvent): void {
7575
reservation.save()
7676
}
7777

78-
function updateIpnftMetadata(ipnft: Ipnft, uri: string, timestamp: BigInt): Ipnft {
78+
function updateIpnftMetadata(ipnft: Ipnft, uri: string, timestamp: BigInt): void {
7979
let ipfsLocation = uri.replace('ipfs://', '');
8080
if (!ipfsLocation || ipfsLocation == uri) {
81-
log.error("Invalid URI format for tokenId {}: {}", [ipnft.id, uri]);
82-
return ipnft;
81+
log.error("Invalid URI format for tokenId {}: {}", [ipnft.id, uri])
82+
return
8383
}
8484

85-
ipnft.tokenURI = uri;
86-
ipnft.metadata = ipfsLocation;
87-
ipnft.updatedAtTimestamp = timestamp;
88-
IpnftMetadataTemplate.create(ipfsLocation);
89-
90-
return ipnft;
85+
ipnft.tokenURI = uri
86+
ipnft.metadata = ipfsLocation
87+
ipnft.updatedAtTimestamp = timestamp
88+
IpnftMetadataTemplate.create(ipfsLocation)
9189
}
9290

9391
//the underlying parameter arrays are misaligned, hence we cannot cast or unify both events
@@ -96,7 +94,7 @@ export function handleMint(event: IPNFTMintedEvent): void {
9694
ipnft.owner = event.params.owner
9795
ipnft.createdAt = event.block.timestamp
9896
ipnft.symbol = event.params.symbol
99-
ipnft = updateIpnftMetadata(ipnft, event.params.tokenURI, event.block.timestamp)
97+
updateIpnftMetadata(ipnft, event.params.tokenURI, event.block.timestamp)
10098
store.remove('Reservation', event.params.tokenId.toString())
10199
ipnft.save()
102100

@@ -116,7 +114,7 @@ export function handleMetadataUpdated(event: MetadataUpdateEvent): void {
116114
log.debug("no new uri found for token, likely just minted {}", [event.params._tokenId.toString()])
117115
return
118116
}
119-
ipnft = updateIpnftMetadata(ipnft, newUri, event.block.timestamp)
117+
updateIpnftMetadata(ipnft, newUri, event.block.timestamp)
120118
ipnft.save()
121119
}
122120

0 commit comments

Comments
 (0)