diff --git a/src/Marketplaces/RaribleExchangeV1.ts b/src/Marketplaces/RaribleExchangeV1.ts index da09922..e0dcf4f 100644 --- a/src/Marketplaces/RaribleExchangeV1.ts +++ b/src/Marketplaces/RaribleExchangeV1.ts @@ -52,7 +52,7 @@ export function handleExchangeV1Buy(event: RaribleExchangeV1Buy): void { let price = event.params.buyValue let buyer = event.params.owner let seller = event.params.buyer - let tokenId = event.params.sellToken.toString() + let tokenId = event.params.buyToken.toString() let bidPrice = getPriceAfterRaribleCut(price) diff --git a/tests/.bin/handletransfer.wasm b/tests/.bin/handletransfer.wasm index 034016b..492bba2 100644 Binary files a/tests/.bin/handletransfer.wasm and b/tests/.bin/handletransfer.wasm differ diff --git a/tests/.latest.json b/tests/.latest.json index 4371eec..6cd89ec 100644 --- a/tests/.latest.json +++ b/tests/.latest.json @@ -1,4 +1,4 @@ { "version": "0.5.3", - "timestamp": 1662746419095 + "timestamp": 1663067442910 } \ No newline at end of file diff --git a/tests/handleTransfer.test.ts b/tests/handleTransfer.test.ts index 36ab225..a53bb19 100644 --- a/tests/handleTransfer.test.ts +++ b/tests/handleTransfer.test.ts @@ -37,8 +37,8 @@ describe('handleTransfer', () => { assert.fieldEquals( 'Punk', Utils.id_STRING, - 'id', - Utils.id_BYTES.toHexString() + 'numberOfTransfers', + Utils.Bi_ONE.toString() ) }) }) diff --git a/tests/helpers/utils.ts b/tests/helpers/utils.ts index bc70c80..55f1661 100644 --- a/tests/helpers/utils.ts +++ b/tests/helpers/utils.ts @@ -29,16 +29,32 @@ export default class Utils { return Bytes.fromHexString('0x0000000000000000000000000000000000000000') } + static get loremIpsum(): string { + return 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor' + } + static get Bi_ZERO(): BigInt { return BigInt.zero() } + static get Bi_ONE(): BigInt { + return BigInt.fromI32(1) + } + static seedAccount(): void { let entity = new Entity() - entity.setString('id', Utils.id_STRING) - entity.setBytes('address', Utils.id_BYTES) - entity.setBigInt('status', Utils.Bi_ZERO) + entity.setBytes('id', Utils.id_BYTES) + entity.setBigInt('averageAmountSpent', Utils.Bi_ZERO) + entity.setBigInt('totalEarned', Utils.Bi_ZERO) + entity.setBigInt('totalSpent', Utils.Bi_ZERO) + entity.setBigInt('numberOfSales', Utils.Bi_ZERO) + entity.setBigInt('numberOfTransfers', Utils.Bi_ZERO) + entity.setBigInt('numberOfPunksAssigned', Utils.Bi_ZERO) + entity.setBigInt('numberOfPunksOwned', Utils.Bi_ZERO) + entity.setBigInt('numberOfPurchases', Utils.Bi_ZERO) + entity.setBigInt('averageAmountSpent', Utils.Bi_ZERO) + entity.setString('accountUrl', Utils.loremIpsum) store.set('Account', Utils.id_STRING, entity) }