Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit f3530a2

Browse files
committed
fix(test): updated ids in tests
1 parent a119c71 commit f3530a2

File tree

3 files changed

+46
-47
lines changed

3 files changed

+46
-47
lines changed

graph/tests/hypercert-minter-burn.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ describe("Describe entity assertions", () => {
6767

6868
handleValueTransfer(valueTransferEvent);
6969

70-
let fractionId = getDefaultContractAddress().toHexString().concat("-1");
70+
let fractionId = "1-".concat(
71+
getDefaultContractAddress().toHexString().concat("-1"),
72+
);
7173

7274
assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString());
7375
assert.fieldEquals("ClaimToken", fractionId, "units", "10000");
@@ -144,7 +146,9 @@ describe("Describe entity assertions", () => {
144146

145147
handleBatchValueTransfer(valueTransferEvent);
146148

147-
let fractionId = getDefaultContractAddress().toHexString().concat("-1");
149+
let fractionId = "1-".concat(
150+
getDefaultContractAddress().toHexString().concat("-1"),
151+
);
148152

149153
assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString());
150154
assert.fieldEquals("ClaimToken", fractionId, "units", "10000");

graph/tests/hypercert-minter-claim.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ describe("Describe entity assertions", () => {
3434
assert.entityCount("Claim", 1);
3535
assert.entityCount("ClaimFraction", 0);
3636

37-
let claimId = getDefaultContractAddress()
38-
.toHexString()
39-
.concat("-".concat(BigInt.fromI64(1).toString()));
37+
let claimId = "1-".concat(
38+
getDefaultContractAddress()
39+
.toHexString()
40+
.concat("-".concat(BigInt.fromI64(1).toString())),
41+
);
4042

4143
assert.fieldEquals("Claim", claimId, "uri", "ipfs://exampleshash");
4244
assert.fieldEquals(

graph/tests/hypercert-minter-fraction.test.ts

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ describe("Describe entity assertions", () => {
3737
let from = Address.fromString("0x0000000000000000000000000000000000000001");
3838
let to = Address.fromString("0x0000000000000000000000000000000000000002");
3939
let operator = Address.fromString(
40-
"0x0000000000000000000000000000000000000003"
40+
"0x0000000000000000000000000000000000000003",
4141
);
4242

4343
let transferSingleEvent = createTransferSingleEvent(
4444
operator,
4545
from,
4646
to,
4747
BigInt.fromI64(1),
48-
BigInt.fromI64(1)
48+
BigInt.fromI64(1),
4949
);
5050

5151
handleTransferSingle(transferSingleEvent);
@@ -68,30 +68,30 @@ describe("Describe entity assertions", () => {
6868
claimID,
6969
fromID,
7070
toID,
71-
units
71+
units,
7272
);
7373

7474
createMockedFunction(
7575
getDefaultContractAddress(),
7676
"ownerOf",
77-
"ownerOf(uint256):(address)"
77+
"ownerOf(uint256):(address)",
7878
)
7979
.withArgs([ethereum.Value.fromUnsignedBigInt(toID)])
8080
.returns([ethereum.Value.fromAddress(from)]);
8181

8282
createMockedFunction(
8383
getDefaultContractAddress(),
8484
"ownerOf",
85-
"ownerOf(uint256):(address)"
85+
"ownerOf(uint256):(address)",
8686
)
8787
.withArgs([ethereum.Value.fromUnsignedBigInt(fromID)])
8888
.returns([ethereum.Value.fromAddress(from)]);
8989

9090
handleValueTransfer(valueTransferEvent);
9191

92-
let fractionId = getDefaultContractAddress()
93-
.toHexString()
94-
.concat("-1");
92+
let fractionId = "1-".concat(
93+
getDefaultContractAddress().toHexString().concat("-1"),
94+
);
9595

9696
assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString());
9797

@@ -100,7 +100,7 @@ describe("Describe entity assertions", () => {
100100
from,
101101
to,
102102
BigInt.fromI64(1),
103-
BigInt.fromI64(1)
103+
BigInt.fromI64(1),
104104
);
105105

106106
handleTransferSingle(transferSingleEvent);
@@ -122,21 +122,21 @@ describe("Describe entity assertions", () => {
122122
claimID,
123123
fromID,
124124
toID,
125-
units
125+
units,
126126
);
127127

128128
createMockedFunction(
129129
getDefaultContractAddress(),
130130
"ownerOf",
131-
"ownerOf(uint256):(address)"
131+
"ownerOf(uint256):(address)",
132132
)
133133
.withArgs([ethereum.Value.fromUnsignedBigInt(toID)])
134134
.returns([ethereum.Value.fromAddress(from)]);
135135

136136
createMockedFunction(
137137
getDefaultContractAddress(),
138138
"ownerOf",
139-
"ownerOf(uint256):(address)"
139+
"ownerOf(uint256):(address)",
140140
)
141141
.withArgs([ethereum.Value.fromUnsignedBigInt(fromID)])
142142
.returns([ethereum.Value.fromAddress(from)]);
@@ -148,18 +148,16 @@ describe("Describe entity assertions", () => {
148148
//TODO also generates claim base token, should this only mint 1 fraction?
149149
assert.entityCount("ClaimToken", 2);
150150

151-
let fractionId = getDefaultContractAddress()
152-
.toHexString()
153-
.concat("-1");
151+
let fractionId = "1-".concat(
152+
getDefaultContractAddress().toHexString().concat("-1"),
153+
);
154154

155155
assert.fieldEquals("ClaimToken", fractionId, "tokenID", "1");
156156
assert.fieldEquals(
157157
"ClaimToken",
158158
fractionId,
159159
"claim",
160-
getDefaultContractAddress()
161-
.toHexString()
162-
.concat("-1")
160+
getDefaultContractAddress().toHexString().concat("-1"),
163161
);
164162
assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString());
165163
assert.fieldEquals("ClaimToken", fractionId, "units", "10000");
@@ -178,21 +176,21 @@ describe("Describe entity assertions", () => {
178176
claimID,
179177
fromID,
180178
toID,
181-
units
179+
units,
182180
);
183181

184182
createMockedFunction(
185183
getDefaultContractAddress(),
186184
"ownerOf",
187-
"ownerOf(uint256):(address)"
185+
"ownerOf(uint256):(address)",
188186
)
189187
.withArgs([ethereum.Value.fromUnsignedBigInt(toID)])
190188
.returns([ethereum.Value.fromAddress(from)]);
191189

192190
createMockedFunction(
193191
getDefaultContractAddress(),
194192
"ownerOf",
195-
"ownerOf(uint256):(address)"
193+
"ownerOf(uint256):(address)",
196194
)
197195
.withArgs([ethereum.Value.fromUnsignedBigInt(fromID)])
198196
.returns([ethereum.Value.fromAddress(from)]);
@@ -201,13 +199,13 @@ describe("Describe entity assertions", () => {
201199

202200
assert.entityCount("ClaimToken", 2);
203201

204-
let fractionIdZero = getDefaultContractAddress()
205-
.toHexString()
206-
.concat("-0");
202+
let fractionIdZero = "1-".concat(
203+
getDefaultContractAddress().toHexString().concat("-0"),
204+
);
207205

208-
let fractionIdOne = getDefaultContractAddress()
209-
.toHexString()
210-
.concat("-1");
206+
let fractionIdOne = "1-".concat(
207+
getDefaultContractAddress().toHexString().concat("-1"),
208+
);
211209

212210
assert.fieldEquals("ClaimToken", fractionIdZero, "tokenID", "0");
213211
assert.fieldEquals("ClaimToken", fractionIdZero, "units", "0");
@@ -220,17 +218,15 @@ describe("Describe entity assertions", () => {
220218
claimID,
221219
toID,
222220
newTokenID,
223-
units
221+
units,
224222
);
225223

226-
let fractionIdTwo = getDefaultContractAddress()
227-
.toHexString()
228-
.concat("-2");
224+
let fractionIdTwo = getDefaultContractAddress().toHexString().concat("-2");
229225

230226
createMockedFunction(
231227
getDefaultContractAddress(),
232228
"ownerOf",
233-
"ownerOf(uint256):(address)"
229+
"ownerOf(uint256):(address)",
234230
)
235231
.withArgs([ethereum.Value.fromUnsignedBigInt(newTokenID)])
236232
.returns([ethereum.Value.fromAddress(from)]);
@@ -261,22 +257,22 @@ describe("Describe entity assertions", () => {
261257
claimIDs,
262258
fromIDs,
263259
toIDs,
264-
values
260+
values,
265261
);
266262

267263
for (let i = 0; i < size.toI64(); i++) {
268264
createMockedFunction(
269265
getDefaultContractAddress(),
270266
"ownerOf",
271-
"ownerOf(uint256):(address)"
267+
"ownerOf(uint256):(address)",
272268
)
273269
.withArgs([ethereum.Value.fromUnsignedBigInt(toIDs[i])])
274270
.returns([ethereum.Value.fromAddress(from)]);
275271

276272
createMockedFunction(
277273
getDefaultContractAddress(),
278274
"ownerOf",
279-
"ownerOf(uint256):(address)"
275+
"ownerOf(uint256):(address)",
280276
)
281277
.withArgs([ethereum.Value.fromUnsignedBigInt(fromIDs[i])])
282278
.returns([ethereum.Value.fromAddress(from)]);
@@ -289,18 +285,15 @@ describe("Describe entity assertions", () => {
289285
//TODO also build 0 token..
290286
assert.entityCount("ClaimToken", 6);
291287

292-
let fractionId = getDefaultContractAddress()
293-
.toHexString()
294-
.concat("-1");
295-
288+
let fractionId = "1-".concat(
289+
getDefaultContractAddress().toHexString().concat("-0"),
290+
);
296291
assert.fieldEquals("ClaimToken", fractionId, "tokenID", "1");
297292
assert.fieldEquals(
298293
"ClaimToken",
299294
fractionId,
300295
"claim",
301-
getDefaultContractAddress()
302-
.toHexString()
303-
.concat("-1")
296+
getDefaultContractAddress().toHexString().concat("-1"),
304297
);
305298
assert.fieldEquals("ClaimToken", fractionId, "owner", from.toHexString());
306299
assert.fieldEquals("ClaimToken", fractionId, "units", "200"); //function of buildValues (100 + i * 100)

0 commit comments

Comments
 (0)