Skip to content

Commit e512c16

Browse files
committed
try to fix publication
1 parent 8ffd3b5 commit e512c16

File tree

5 files changed

+14
-28
lines changed

5 files changed

+14
-28
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
- name: Build using gradle
4343
uses: gradle/gradle-build-action@v2
4444
with:
45-
arguments: ${{ matrix.gradle_args }} closeAndReleaseSonatypeStagingRepository
45+
arguments: ${{ matrix.gradle_args }}

ton-kotlin-api/src/commonMain/kotlin/org/ton/api/tonnode/TonNodeBlockId.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
package org.ton.api.tonnode
44

5-
import io.ktor.utils.io.core.*
65
import kotlinx.serialization.Serializable
76
import org.ton.tl.TlCodec
87
import org.ton.tl.TlConstructor
@@ -66,7 +65,7 @@ private data class TonNodeBlockIdImpl(
6665
) : TonNodeBlockId {
6766
override fun withSeqno(seqno: Int): TonNodeBlockId = copy(seqno = seqno)
6867

69-
override fun toString(): String = "($workchain:${shard.toString(16).uppercase()}:$seqno)"
68+
override fun toString(): String = "($workchain:${shard.toShard().hex()}:$seqno)"
7069
}
7170

7271
private object TonNodeBlockIdTlbConstructor : TlConstructor<TonNodeBlockId>(

ton-kotlin-hashmap/src/commonMain/kotlin/org/ton/hashmap/HashmapAug.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ internal class AhmnNodeIterator<X, Y>(
187187
edge
188188
} else {
189189
addState(prefix, node)
190-
// println("goto next")
191190
gotoNext()
192191
}
193192
}

ton-kotlin-liteclient/src/commonMain/kotlin/org/ton/lite/client/LiteClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ public class LiteClient(
296296
result
297297
}
298298

299+
public suspend fun getBlock(blockId: TonNodeBlockId): Block? {
300+
val blockIdExt = lookupBlock(blockId) ?: return null
301+
return getBlock(blockIdExt)
302+
}
303+
299304
public suspend fun getBlock(blockId: TonNodeBlockIdExt): Block? {
300305
val blockData = try {
301306
liteApi(LiteServerGetBlock(blockId))
Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
11
import kotlinx.coroutines.Dispatchers
22
import kotlinx.coroutines.runBlocking
3-
import org.ton.api.liteclient.config.LiteClientConfigGlobal
4-
import org.ton.api.liteserver.LiteServerDesc
5-
import org.ton.api.pub.PublicKeyEd25519
3+
import org.ton.api.tonnode.Shard
64
import org.ton.api.tonnode.TonNodeBlockId
7-
import org.ton.api.validator.config.ValidatorConfigGlobal
8-
import org.ton.crypto.base64
95
import org.ton.lite.client.LiteClient
106

11-
fun main() {
7+
fun main() = runBlocking {
128
val liteClient = LiteClient(
139
coroutineContext = Dispatchers.Default,
14-
liteClientConfigGlobal = LiteClientConfigGlobal(
15-
liteServers = listOf(
16-
LiteServerDesc(
17-
id = PublicKeyEd25519(base64("p2tSiaeSqX978BxE5zLxuTQM06WVDErf5/15QToxMYA=")),
18-
ip = 1097649206,
19-
port = 29296
20-
)
21-
),
22-
validator = ValidatorConfigGlobal()
23-
)
10+
liteClientConfigGlobal = GLOBAL_CONFIG
2411
)
25-
val blockId = 8573000
26-
runBlocking {
27-
liteClient.lookupBlock(
28-
TonNodeBlockId(workchain = 0, shard = Long.MIN_VALUE, seqno = blockId)
29-
)?.let {
30-
println(liteClient.getBlock(it))
31-
}
32-
}
12+
val blockId = 27750192
13+
val block = liteClient.getBlock(TonNodeBlockId(-1, Shard.ID_ALL, 27750192)) ?: error("no block")
14+
// println(block)
15+
val accountBlocks = block.extra.value.accountBlocks.value
3316
}

0 commit comments

Comments
 (0)