Skip to content

Commit

Permalink
assign pool in mergeOrRemove entity
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNoepel committed Oct 5, 2023
1 parent 9d75106 commit 7ef2da4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mappings/erc-721-pool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ByteArray, Bytes, ethereum } from "@graphprotocol/graph-ts"
import { ByteArray, Bytes, ethereum, log } from "@graphprotocol/graph-ts"
import {
AddCollateralNFT as AddCollateralNFTEvent,
AddQuoteToken as AddQuoteTokenEvent,
Expand Down Expand Up @@ -355,6 +355,7 @@ export function handleMergeOrRemoveCollateralNFT(

// use transaction metadata to access the list of removalIndexes
const dataWithoutSelector = event.transaction.input.subarray(4)
log.warning("mergeOrRemove event.transaction.input {}", [event.transaction.input.toHexString()])
//prepend a "tuple" prefix (function params are arrays, not tuples)
const tuplePrefix = ByteArray.fromHexString(
'0x0000000000000000000000000000000000000000000000000000000000000020'
Expand Down Expand Up @@ -405,6 +406,7 @@ export function handleMergeOrRemoveCollateralNFT(
pool.bucketTokenIds = findAndRemoveTokenIds(tokenIdsToRemove, pool.bucketTokenIds)
}

mergeOrRemove.pool = pool.id
updateAccountPools(account, pool)

// save entities to store
Expand Down

0 comments on commit 7ef2da4

Please sign in to comment.