Skip to content

Commit

Permalink
more progress with matchstick
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjerryokolo committed Sep 13, 2022
1 parent 0810895 commit 6269800
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Marketplaces/RaribleExchangeV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Binary file modified tests/.bin/handletransfer.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/.latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.5.3",
"timestamp": 1662746419095
"timestamp": 1663067442910
}
4 changes: 2 additions & 2 deletions tests/handleTransfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe('handleTransfer', () => {
assert.fieldEquals(
'Punk',
Utils.id_STRING,
'id',
Utils.id_BYTES.toHexString()
'numberOfTransfers',
Utils.Bi_ONE.toString()
)
})
})
Expand Down
22 changes: 19 additions & 3 deletions tests/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 6269800

Please sign in to comment.