-
Notifications
You must be signed in to change notification settings - Fork 8
/
market_options_test.go
60 lines (43 loc) · 1.37 KB
/
market_options_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package test_main
import (
"testing"
. "github.com/bjartek/overflow"
)
func TestMarketOptions(t *testing.T) {
otu := NewOverflowTest(t).
setupFIND().
setupDandy("user1").
createUser(100.0, "user2").
registerUser("user2").
setFlowDandyMarketOption("find")
price := 10.0
ids := otu.mintThreeExampleDandies()
otu.registerFtInRegistry()
otu.setUUID(400)
listingTx := otu.O.TxFN(
WithSigner("user1"),
WithArg("nftAliasOrIdentifier", dandyNFTType(otu)),
WithArg("id", ids[1]),
WithArg("ftAliasOrIdentifier", "Flow"),
WithArg("directSellPrice", price),
WithArg("validUntil", 100.0),
)
/* Test on TenantRules removal and setting */
t.Run("Should be able to list if the rules are set for MarketSale, regardless of the others.", func(t *testing.T) {
listingTx("listNFTForSale").
AssertSuccess(t)
otu.delistAllNFT("user1")
})
/* Test on SaleItem removal and setting */
t.Run("Should be able to list if the rules are set for MarketSale, regardless of the others.", func(t *testing.T) {
/* Should success for both market types */
otu.listNFTForEscrowedAuction("user1", ids[0], price).
listNFTForSale("user1", ids[1], price)
otu.removeMarketOption("FlowDandyEscrow")
/* Should fail for MarketSale */
listingTx("listNFTForSale").
AssertFailure(t, "Nothing matches")
otu.setFlowDandyMarketOption("find")
otu.delistAllNFT("user1")
})
}