Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ object AvmChainSpecific : AbstractPollChainSpecific() {
val status = Global.objectMapper.readValue(data, AvmStatus::class.java)
val round = status.lastRound
val blockRequest = ChainRequest(
"GET#/v2/blocks/$round",
// template method with the round as a path param, so the metrics `method` label stays bounded
"GET#/v2/blocks/*",
RestParams(
headers = emptyList(),
queryParams = listOf("format" to "json", "header-only" to "true"),
pathParams = emptyList(),
pathParams = listOf(round.toString()),
payload = ByteArray(0),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.emeraldpay.dshackle.reader.ChainReader
import io.emeraldpay.dshackle.upstream.ChainRequest
import io.emeraldpay.dshackle.upstream.ChainResponse
import io.emeraldpay.dshackle.upstream.UpstreamAvailability
import io.emeraldpay.dshackle.upstream.rpcclient.RestParams
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test
import reactor.core.publisher.Mono
Expand Down Expand Up @@ -55,7 +56,8 @@ class AvmChainSpecificTest {
fun parseBlockChainsThroughBlockEndpoint() {
val reader = object : ChainReader {
override fun read(key: ChainRequest): Mono<ChainResponse> {
Assertions.assertThat(key.method).isEqualTo("GET#/v2/blocks/30000000")
Assertions.assertThat(key.method).isEqualTo("GET#/v2/blocks/*")
Assertions.assertThat((key.params as RestParams).pathParams).containsExactly("30000000")
return Mono.just(ChainResponse(avmBlockHeader.toByteArray(), null))
}
}
Expand Down
Loading