Skip to content

Commit 935d172

Browse files
committed
[SDK] minor fix for test
1 parent f8c981c commit 935d172

File tree

1 file changed

+68
-65
lines changed

1 file changed

+68
-65
lines changed

packages/thirdweb/src/extensions/erc1155/write/mintAdditionalSupplyToBatch.test.ts

Lines changed: 68 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -14,74 +14,77 @@ const chain = ANVIL_CHAIN;
1414
const client = TEST_CLIENT;
1515
const account = TEST_ACCOUNT_C;
1616

17-
describe("ERC1155 Edition: mintToBatch", () => {
18-
it("should mint multiple tokens in one tx", async () => {
19-
const contract = getContract({
20-
chain,
21-
client,
22-
address: await deployERC1155Contract({
17+
describe.runIf(process.env.TW_SECRET_KEY)(
18+
"ERC1155 Edition: mintToBatch",
19+
() => {
20+
it("should mint multiple tokens in one tx", async () => {
21+
const contract = getContract({
2322
chain,
2423
client,
24+
address: await deployERC1155Contract({
25+
chain,
26+
client,
27+
account,
28+
type: "TokenERC1155",
29+
params: {
30+
name: "edition",
31+
contractURI: TEST_CONTRACT_URI,
32+
},
33+
}),
34+
});
35+
36+
await sendAndConfirmTransaction({
2537
account,
26-
type: "TokenERC1155",
27-
params: {
28-
name: "edition",
29-
contractURI: TEST_CONTRACT_URI,
30-
},
31-
}),
32-
});
38+
transaction: mintToBatch({
39+
contract,
40+
to: account.address,
41+
nfts: [
42+
{ metadata: { name: "token 0" }, supply: 1n },
43+
{ metadata: { name: "token 1" }, supply: 2n },
44+
{ metadata: { name: "token 2" }, supply: 3n },
45+
],
46+
}),
47+
});
3348

34-
await sendAndConfirmTransaction({
35-
account,
36-
transaction: mintToBatch({
37-
contract,
38-
to: account.address,
39-
nfts: [
40-
{ metadata: { name: "token 0" }, supply: 1n },
41-
{ metadata: { name: "token 1" }, supply: 2n },
42-
{ metadata: { name: "token 2" }, supply: 3n },
43-
],
44-
}),
45-
});
49+
await sendAndConfirmTransaction({
50+
account,
51+
transaction: mintAdditionalSupplyToBatch({
52+
contract,
53+
nfts: [
54+
{ tokenId: 0n, supply: 99n, to: account.address },
55+
{ tokenId: 1n, supply: 98n, to: account.address },
56+
{ tokenId: 2n, supply: 97n, to: account.address },
57+
],
58+
}),
59+
});
4660

47-
await sendAndConfirmTransaction({
48-
account,
49-
transaction: mintAdditionalSupplyToBatch({
50-
contract,
51-
nfts: [
52-
{ tokenId: 0n, supply: 99n, to: account.address },
53-
{ tokenId: 1n, supply: 98n, to: account.address },
54-
{ tokenId: 2n, supply: 97n, to: account.address },
55-
],
56-
}),
61+
const nfts = await getNFTs({ contract });
62+
expect(nfts).toStrictEqual([
63+
{
64+
metadata: { name: "token 0" },
65+
owner: null,
66+
id: 0n,
67+
tokenURI: "ipfs://QmPZ6LpGqMuFbHKTXrNW1NRNLHf1nrxS4dtoFqdZZTKvPX/0",
68+
type: "ERC1155",
69+
supply: 100n,
70+
},
71+
{
72+
metadata: { name: "token 1" },
73+
owner: null,
74+
id: 1n,
75+
tokenURI: "ipfs://QmRFPyc3yEYxR4pQxwyTQWTine51TxWCoD6nzJWR3eX45b/0",
76+
type: "ERC1155",
77+
supply: 100n,
78+
},
79+
{
80+
metadata: { name: "token 2" },
81+
owner: null,
82+
id: 2n,
83+
tokenURI: "ipfs://QmesQiRLHCgqWZM2GFCs7Nb7rr2S72hU1BVQc7xiTyKZtT/0",
84+
type: "ERC1155",
85+
supply: 100n,
86+
},
87+
]);
5788
});
58-
59-
const nfts = await getNFTs({ contract });
60-
expect(nfts).toStrictEqual([
61-
{
62-
metadata: { name: "token 0" },
63-
owner: null,
64-
id: 0n,
65-
tokenURI: "ipfs://QmPZ6LpGqMuFbHKTXrNW1NRNLHf1nrxS4dtoFqdZZTKvPX/0",
66-
type: "ERC1155",
67-
supply: 100n,
68-
},
69-
{
70-
metadata: { name: "token 1" },
71-
owner: null,
72-
id: 1n,
73-
tokenURI: "ipfs://QmRFPyc3yEYxR4pQxwyTQWTine51TxWCoD6nzJWR3eX45b/0",
74-
type: "ERC1155",
75-
supply: 100n,
76-
},
77-
{
78-
metadata: { name: "token 2" },
79-
owner: null,
80-
id: 2n,
81-
tokenURI: "ipfs://QmesQiRLHCgqWZM2GFCs7Nb7rr2S72hU1BVQc7xiTyKZtT/0",
82-
type: "ERC1155",
83-
supply: 100n,
84-
},
85-
]);
86-
});
87-
});
89+
},
90+
);

0 commit comments

Comments
 (0)