We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0d6497 commit eb5a500Copy full SHA for eb5a500
mock/nft_mock_test.go
@@ -0,0 +1,31 @@
1
+package mock
2
+
3
+import (
4
+ "math/big"
5
+ "testing"
6
7
+ "github.com/ethereum/go-ethereum/common"
8
+ "github.com/ethereum/go-ethereum/core/types"
9
+ "github.com/stretchr/testify/assert"
10
+)
11
12
+func TestMockNFTDetector(t *testing.T) {
13
+ detector := NewMockNFTDetector()
14
15
+ t.Run("Known contract", func(t *testing.T) {
16
+ detector.Reset()
17
+ address := common.HexToAddress("0xBAYC")
18
+ detector.AddKnownContract(address)
19
20
+ tx := types.NewTransaction(
21
+ 0,
22
+ address, // Remove & operator, use Address directly
23
+ big.NewInt(0),
24
+ 21000,
25
+ big.NewInt(1),
26
+ nil,
27
+ )
28
+ result := detector.IsNFTTransaction(tx)
29
+ assert.True(t, result)
30
+ })
31
+}
0 commit comments