Skip to content

Commit 9af3fa0

Browse files
authored
Marketplace Extensions (#85)
1 parent 179904c commit 9af3fa0

File tree

8 files changed

+1776
-2
lines changed

8 files changed

+1776
-2
lines changed

Thirdweb.Console/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
#endregion
7676

77-
// #region AA ZkSync
77+
#region AA ZkSync
7878

7979
// var zkSmartWallet = await SmartWallet.Create(personalWallet: privateKeyWallet, chainId: 4654, gasless: true);
8080

@@ -89,7 +89,7 @@
8989

9090
// Console.WriteLine($"Transaction hash: {hash}");
9191

92-
// #endregion
92+
#endregion
9393

9494
#region Ecosystem Wallet
9595

Thirdweb.Tests/Thirdweb.Extensions/Thirdweb.Extensions.Tests.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,33 @@ public async Task NullChecks()
117117

118118
// ERC721_TokenByIndex
119119
_ = await Assert.ThrowsAsync<ArgumentNullException>(() => ThirdwebExtensions.ERC721_TokenByIndex(null, 0));
120+
121+
// SupportsInterface
122+
_ = await Assert.ThrowsAsync<ArgumentNullException>(() => ThirdwebExtensions.SupportsInterface(null, "0x01ffc9a7"));
123+
}
124+
125+
[Fact(Timeout = 120000)]
126+
public async Task SupportsInterface_ERC721()
127+
{
128+
var contract = await this.GetDrop721Contract();
129+
var supportsInterface = await contract.SupportsInterface(Constants.IERC721_INTERFACE_ID);
130+
Assert.True(supportsInterface);
131+
}
132+
133+
[Fact(Timeout = 120000)]
134+
public async Task SupportsInterface_ERC1155()
135+
{
136+
var contract = await this.GetDrop1155Contract();
137+
var supportsInterface = await contract.SupportsInterface(Constants.IERC1155_INTERFACE_ID);
138+
Assert.True(supportsInterface);
139+
}
140+
141+
[Fact(Timeout = 120000)]
142+
public async Task SupportsInterface_False()
143+
{
144+
var contract = await this.GetTokenERC20Contract();
145+
var supportsInterface = await contract.SupportsInterface(Constants.IERC721_INTERFACE_ID);
146+
Assert.False(supportsInterface);
120147
}
121148

122149
[Fact(Timeout = 120000)]

0 commit comments

Comments
 (0)