-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update tx grpc query to use new structure * fix lint * add change log entry * remove empty line * fix lint
- Loading branch information
1 parent
7abdd12
commit b476b5f
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
service/src/test/kotlin/io/provenance/explorer/grpc/v1/TransactionGrpcClientTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") | ||
} | ||
} | ||
} |