-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4e5bb9
commit f9dfc70
Showing
7 changed files
with
65 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM --platform=linux/x86_64 ubuntu:20.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ENV ARGS="" | ||
|
||
RUN apt update \ | ||
&& apt install -y sudo curl postgresql \ | ||
&& curl -fsSL https://deb.nodesource.com/setup_16.x | sudo bash - \ | ||
&& sudo apt install -y nodejs | ||
|
||
RUN curl -OL https://github.com/LimeChain/matchstick/releases/download/0.4.4/binary-linux-20 \ | ||
&& chmod a+x binary-linux-20 | ||
|
||
RUN mkdir matchstick | ||
WORKDIR /matchstick | ||
|
||
# Commenting out for now as it seems there's no need to copy when using bind mount | ||
# COPY ./ . | ||
|
||
CMD ../binary-linux-20 ${ARGS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
import { Address, ethereum, BigInt } from "@graphprotocol/graph-ts"; | ||
import { clearStore, test, assert, describe, beforeEach, newMockEvent } from "matchstick-as/assembly/index"; | ||
import { Collection } from "../generated/schema"; | ||
import { createCollection, createNewMockTransferEvent } from "./helper"; | ||
import { | ||
Transfer | ||
} from "../generated/ERC721/ERC721" | ||
import { Address, BigInt } from "@graphprotocol/graph-ts"; | ||
import { test, describe, beforeEach, assert } from "matchstick-as/assembly/index"; | ||
import { ADDRESS_ZERO, colllectionAddress1, createCollection, createNewMockTransferEvent } from "./helper"; | ||
import {handleTransfer} from "../src/mapping" | ||
|
||
describe("ERC721 Tests", () => { | ||
beforeEach(() => { | ||
createCollection(); | ||
}) | ||
test("Transfer - Mint", () => { | ||
let from = Address.fromString("0x28c6c06298d514db089934071355e5743bf21d60"); | ||
// Arrange | ||
let from = ADDRESS_ZERO; | ||
let to = Address.fromString("0x0dda28d190b17ba5a8774064de4386347b33220e"); | ||
let tokenId = BigInt.fromString("1"); | ||
let mockTransferEvent = createNewMockTransferEvent(from, to, tokenId); | ||
|
||
assert.entityCount("Collection", 1); | ||
|
||
// Act | ||
handleTransfer(mockTransferEvent); | ||
|
||
let expectedCollectibleId = colllectionAddress1.toHex() + "-" + tokenId.toHex(); | ||
|
||
// Assert | ||
assert.entityCount("Account", 2); | ||
assert.fieldEquals("Collectible", expectedCollectibleId, "owner", to.toHexString()); | ||
assert.fieldEquals("Collectible", expectedCollectibleId, "creator", to.toHexString()); | ||
}) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters