Skip to content

Commit a1e3566

Browse files
authored
Merge pull request #4 from dapperlabs/sadie/update-uints
use uint64 instead of uint32
2 parents 03d3b2f + 0f80a79 commit a1e3566

18 files changed

+169
-169
lines changed

contracts/AllDay.cdc

Lines changed: 82 additions & 82 deletions
Large diffs are not rendered by default.

lib/go/test/allday_test.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func testCreateSeries(
8181
b *emulator.Blockchain,
8282
contracts Contracts,
8383
seriesName string,
84-
shouldBeID uint32,
84+
shouldBeID uint64,
8585
shouldRevert bool,
8686
) {
8787
createSeries(
@@ -104,7 +104,7 @@ func testCloseSeries(
104104
t *testing.T,
105105
b *emulator.Blockchain,
106106
contracts Contracts,
107-
seriesID uint32,
107+
seriesID uint64,
108108
shouldRevert bool,
109109
) {
110110
wasActive := getSeriesData(t, b, contracts, seriesID).Active
@@ -164,7 +164,7 @@ func testCreateSet(
164164
b *emulator.Blockchain,
165165
contracts Contracts,
166166
setName string,
167-
shouldBeID uint32,
167+
shouldBeID uint64,
168168
shouldRevert bool,
169169
) {
170170
createSet(
@@ -223,7 +223,7 @@ func testCreatePlay(
223223
contracts Contracts,
224224
classification string,
225225
metadata map[string]string,
226-
shouldBeID uint32,
226+
shouldBeID uint64,
227227
shouldRevert bool,
228228
) {
229229
createPlay(
@@ -256,12 +256,12 @@ func testCreateEdition(
256256
t *testing.T,
257257
b *emulator.Blockchain,
258258
contracts Contracts,
259-
seriesID uint32,
260-
setID uint32,
261-
playID uint32,
262-
maxMintSize *uint32,
259+
seriesID uint64,
260+
setID uint64,
261+
playID uint64,
262+
maxMintSize *uint64,
263263
tier string,
264-
shouldBeID uint32,
264+
shouldBeID uint64,
265265
shouldRevert bool,
266266
) {
267267
createEdition(
@@ -293,8 +293,8 @@ func testCloseEdition(
293293
t *testing.T,
294294
b *emulator.Blockchain,
295295
contracts Contracts,
296-
editionID uint32,
297-
shouldBeID uint32,
296+
editionID uint64,
297+
shouldBeID uint64,
298298
shouldRevert bool,
299299
) {
300300
closeEdition(
@@ -312,7 +312,7 @@ func testCloseEdition(
312312
}
313313

314314
func createTestEditions(t *testing.T, b *emulator.Blockchain, contracts Contracts) {
315-
var maxMintSize uint32 = 2
315+
var maxMintSize uint64 = 2
316316
createTestSeries(t, b, contracts)
317317
createTestSets(t, b, contracts)
318318
createTestPlays(t, b, contracts)
@@ -420,10 +420,10 @@ func TestMomentNFTs(t *testing.T) {
420420
t,
421421
b,
422422
contracts,
423-
uint32(1),
423+
uint64(1),
424424
userAddress,
425425
uint64(1),
426-
uint32(1),
426+
uint64(1),
427427
false,
428428
)
429429
})
@@ -433,10 +433,10 @@ func TestMomentNFTs(t *testing.T) {
433433
t,
434434
b,
435435
contracts,
436-
uint32(1),
436+
uint64(1),
437437
userAddress,
438438
uint64(2),
439-
uint32(2),
439+
uint64(2),
440440
false,
441441
)
442442
})
@@ -446,10 +446,10 @@ func TestMomentNFTs(t *testing.T) {
446446
t,
447447
b,
448448
contracts,
449-
uint32(2),
449+
uint64(2),
450450
userAddress,
451451
uint64(3),
452-
uint32(1),
452+
uint64(1),
453453
false,
454454
)
455455
})
@@ -459,10 +459,10 @@ func TestMomentNFTs(t *testing.T) {
459459
t,
460460
b,
461461
contracts,
462-
uint32(2),
462+
uint64(2),
463463
userAddress,
464464
uint64(4),
465-
uint32(2),
465+
uint64(2),
466466
false,
467467
)
468468
})
@@ -472,10 +472,10 @@ func TestMomentNFTs(t *testing.T) {
472472
t,
473473
b,
474474
contracts,
475-
uint32(1),
475+
uint64(1),
476476
userAddress,
477477
uint64(3),
478-
uint32(3),
478+
uint64(3),
479479
true,
480480
)
481481
})
@@ -485,10 +485,10 @@ func TestMomentNFTs(t *testing.T) {
485485
t,
486486
b,
487487
contracts,
488-
uint32(3),
488+
uint64(3),
489489
userAddress,
490490
uint64(1),
491-
uint32(1),
491+
uint64(1),
492492
true,
493493
)
494494
})
@@ -498,10 +498,10 @@ func testMintMomentNFT(
498498
t *testing.T,
499499
b *emulator.Blockchain,
500500
contracts Contracts,
501-
editionID uint32,
501+
editionID uint64,
502502
userAddress flow.Address,
503503
shouldBeID uint64,
504-
shouldBeSerialNumber uint32,
504+
shouldBeSerialNumber uint64,
505505
shouldRevert bool,
506506
) {
507507
// Make sure the total supply of NFTs is tracked correctly
@@ -583,10 +583,10 @@ func TestShardedCollection(t *testing.T) {
583583
t,
584584
b,
585585
contracts,
586-
uint32(2),
586+
uint64(2),
587587
user1Address,
588588
uint64(numMomentNFTsAlready+i),
589-
uint32(numMomentNFTsAlready+i),
589+
uint64(numMomentNFTsAlready+i),
590590
false,
591591
)
592592
}

lib/go/test/scripts.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ func getSeriesData(
2626
t *testing.T,
2727
b *emulator.Blockchain,
2828
contracts Contracts,
29-
id uint32,
29+
id uint64,
3030
) SeriesData {
3131
script := loadAllDayReadSeriesByIDScript(contracts)
32-
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt32(id))})
32+
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt64(id))})
3333

3434
return parseSeriesData(result)
3535
}
@@ -38,10 +38,10 @@ func getSetData(
3838
t *testing.T,
3939
b *emulator.Blockchain,
4040
contracts Contracts,
41-
id uint32,
41+
id uint64,
4242
) SetData {
4343
script := loadAllDayReadSetByIDScript(contracts)
44-
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt32(id))})
44+
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt64(id))})
4545

4646
return parseSetData(result)
4747
}
@@ -50,10 +50,10 @@ func getPlayData(
5050
t *testing.T,
5151
b *emulator.Blockchain,
5252
contracts Contracts,
53-
id uint32,
53+
id uint64,
5454
) PlayData {
5555
script := loadAllDayReadPlayByIDScript(contracts)
56-
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt32(id))})
56+
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt64(id))})
5757

5858
return parsePlayData(result)
5959
}
@@ -62,10 +62,10 @@ func getEditionData(
6262
t *testing.T,
6363
b *emulator.Blockchain,
6464
contracts Contracts,
65-
id uint32,
65+
id uint64,
6666
) EditionData {
6767
script := loadAllDayReadEditionByIDScript(contracts)
68-
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt32(id))})
68+
result := executeScriptAndCheck(t, b, script, [][]byte{jsoncdc.MustEncode(cadence.UInt64(id))})
6969

7070
return parseEditionData(result)
7171
}

lib/go/test/transactions.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func closeSeries(
172172
t *testing.T,
173173
b *emulator.Blockchain,
174174
contracts Contracts,
175-
id uint32,
175+
id uint64,
176176
shouldRevert bool,
177177
) {
178178
tx := flow.NewTransaction().
@@ -181,7 +181,7 @@ func closeSeries(
181181
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
182182
SetPayer(b.ServiceKey().Address).
183183
AddAuthorizer(contracts.AllDayAddress)
184-
tx.AddArgument(cadence.NewUInt32(id))
184+
tx.AddArgument(cadence.NewUInt64(id))
185185

186186
signAndSubmit(
187187
t, b, tx,
@@ -252,10 +252,10 @@ func createEdition(
252252
t *testing.T,
253253
b *emulator.Blockchain,
254254
contracts Contracts,
255-
seriesID uint32,
256-
setID uint32,
257-
playID uint32,
258-
maxMintSize *uint32,
255+
seriesID uint64,
256+
setID uint64,
257+
playID uint64,
258+
maxMintSize *uint64,
259259
tier string,
260260
shouldRevert bool,
261261
) {
@@ -265,12 +265,12 @@ func createEdition(
265265
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
266266
SetPayer(b.ServiceKey().Address).
267267
AddAuthorizer(contracts.AllDayAddress)
268-
tx.AddArgument(cadence.NewUInt32(seriesID))
269-
tx.AddArgument(cadence.NewUInt32(setID))
270-
tx.AddArgument(cadence.NewUInt32(playID))
268+
tx.AddArgument(cadence.NewUInt64(seriesID))
269+
tx.AddArgument(cadence.NewUInt64(setID))
270+
tx.AddArgument(cadence.NewUInt64(playID))
271271
tx.AddArgument(cadence.NewString(tier))
272272
if maxMintSize != nil {
273-
tx.AddArgument(cadence.NewUInt32(*maxMintSize))
273+
tx.AddArgument(cadence.NewUInt64(*maxMintSize))
274274
} else {
275275
tx.AddArgument(cadence.Optional{})
276276
}
@@ -287,7 +287,7 @@ func closeEdition(
287287
t *testing.T,
288288
b *emulator.Blockchain,
289289
contracts Contracts,
290-
editionID uint32,
290+
editionID uint64,
291291
shouldRevert bool,
292292
) {
293293
tx := flow.NewTransaction().
@@ -296,7 +296,7 @@ func closeEdition(
296296
SetProposalKey(b.ServiceKey().Address, b.ServiceKey().Index, b.ServiceKey().SequenceNumber).
297297
SetPayer(b.ServiceKey().Address).
298298
AddAuthorizer(contracts.AllDayAddress)
299-
tx.AddArgument(cadence.NewUInt32(editionID))
299+
tx.AddArgument(cadence.NewUInt64(editionID))
300300

301301
signAndSubmit(
302302
t, b, tx,
@@ -314,7 +314,7 @@ func mintMomentNFT(
314314
b *emulator.Blockchain,
315315
contracts Contracts,
316316
recipientAddress flow.Address,
317-
editionID uint32,
317+
editionID uint64,
318318
shouldRevert bool,
319319
) {
320320
tx := flow.NewTransaction().
@@ -324,7 +324,7 @@ func mintMomentNFT(
324324
SetPayer(b.ServiceKey().Address).
325325
AddAuthorizer(contracts.AllDayAddress)
326326
tx.AddArgument(cadence.BytesToAddress(recipientAddress.Bytes()))
327-
tx.AddArgument(cadence.NewUInt32(editionID))
327+
tx.AddArgument(cadence.NewUInt64(editionID))
328328

329329
signAndSubmit(
330330
t, b, tx,

0 commit comments

Comments
 (0)