Skip to content

Commit 07dc693

Browse files
committed
fix supportsinterface
1 parent 3c69aa0 commit 07dc693

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

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)