Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update grpc tx endpoint to use new query property #523

Merged
merged 5 commits into from
Jul 9, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
## Unreleased

* Updated Prov Protos to 1.19.0-rc2 [#522](https://github.com/provenance-io/explorer-service/pull/522)
* Updated gRPC query to use `query` field instead of `events` field [#523](https://github.com/provenance-io/explorer-service/pull/523)

## [v5.10.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.10.0) - 2024-06-11
### Release Name: Fridtjof Nansen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TransactionGrpcClient(channelUri: URI) {
do {
txClient.getTxsEvent(
getTxsEventRequest {
this.events.add("tx.height=$height")
this.query = "tx.height=$height"
this.limit = limit.toLong()
this.page = page.toLong()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.provenance.explorer.grpc.v1

import cosmos.tx.v1beta1.ServiceOuterClass
import io.provenance.explorer.domain.exceptions.TendermintApiException
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import java.net.URI

class TransactionGrpcClientTest {

@Test
@Disabled("Test was used to manually call the endpoint")
fun `test getTxsByHeight success`() = runBlocking {
val uri = URI("grpcs://grpc.test.provenance.io:443")
val transactionGrpcClient = TransactionGrpcClient(uri)

try {
val height = 23440770
val total = 1

val txResponses: List<ServiceOuterClass.GetTxResponse> = transactionGrpcClient.getTxsByHeight(height, total)

txResponses.forEach { txResponse ->
println("TxResponse: ${txResponse.txResponse}")
println("Tx: ${txResponse.tx}")
}
} catch (e: TendermintApiException) {
println("Error occurred: ${e.message}")
}
}
}
Loading