-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGetMethodsTest.kt
49 lines (41 loc) · 1.62 KB
/
GetMethodsTest.kt
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
package org.ton.tonkotlinusecase
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.ton.block.AddrStd
import org.ton.tonkotlinusecase.contracts.LiteContract
@SpringBootTest
class GetMethodsTest: BaseTest() {
@Autowired
protected lateinit var liteContract: LiteContract
@Test
fun `get_nft_data of a single nft`() {
runBlocking {
val data = liteContract.getNftData(AddrStd("EQCDMCErrbb19GLCcKyxxhw9OjPBfstj3_zjh70vp1x_53_l"))!!
println(
data.ownerAddress.toAddrString()
)
assertEquals("EQCf34cKfT8kaYO51cMjfxsLTxnk8eyzQ0Q8QSVZA-6apqEl", data.ownerAddress.toAddrString())
}
}
@Test
fun `get collectable nft address by index`() {
val index = 0
val collectionAddress = AddrStd("EQAd8b25yIfvDScaMZWhF03mdUcfiyqbK_LoVK1fJ8QBqvQN")
runBlocking {
val nftAddress = liteContract.getItemAddressByIndex(collectionAddress, index)
println(nftAddress?.toAddrString())
assertEquals("EQB7R7t8aFIdSGEmw_Owvsx6NVqIFySJAgVMasa9zJis37Nr", nftAddress?.toAddrString())
}
}
@Test
fun `get collection data`() {
val collectionAddress = AddrStd("EQAd8b25yIfvDScaMZWhF03mdUcfiyqbK_LoVK1fJ8QBqvQN")
runBlocking {
val collectionData = liteContract.getCollectionData(collectionAddress)
println(collectionData?.owner?.toAddrString())
}
}
}