Skip to content

Commit

Permalink
Add getUTxOInfo Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudi Edri committed Nov 8, 2023
1 parent 619ff64 commit 148a85b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import rest.koios.client.backend.api.base.Result;
import rest.koios.client.backend.api.base.common.UTxO;
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.api.transactions.model.*;
import rest.koios.client.backend.factory.BackendFactory;
Expand All @@ -27,6 +28,16 @@ public void setup() {
transactionsService = BackendFactory.getKoiosMainnetService().getTransactionsService();
}

@Test
void getUTxOInfoTest() throws ApiException {
List<String> utxoRefs = List.of("f144a8264acf4bdfe2e1241170969c930d64ab6b0996a4a45237b623f1dd670e#0",
"0b8ba3bed976fa4913f19adc9f6dd9063138db5b4dd29cecde369456b5155e94#0");
Result<List<UTxO>> utxosResult = transactionsService.getUTxOInfo(utxoRefs, false);
Assertions.assertTrue(utxosResult.isSuccessful());
Assertions.assertNotNull(utxosResult.getValue());
log.info(utxosResult.getValue().toString());
}

@Test
void getTransactionInformationTest() throws ApiException {
String txHash = "f144a8264acf4bdfe2e1241170969c930d64ab6b0996a4a45237b623f1dd670e";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import rest.koios.client.backend.api.base.Result;
import rest.koios.client.backend.api.base.common.UTxO;
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.api.transactions.model.*;
import rest.koios.client.backend.factory.BackendFactory;
Expand All @@ -27,6 +28,16 @@ public void setup() {
transactionsService = BackendFactory.getKoiosPreprodService().getTransactionsService();
}

@Test
void getUTxOInfoTest() throws ApiException {
List<String> utxoRefs = List.of("d10133964da9e443b303917fd0b7644ae3d01c133deff85b4f59416c2d00f530#0",
"145688d3619e7524510ea64c0ec6363b77a9b8da179ef9bb0273a0940d57d576#0");
Result<List<UTxO>> utxosResult = transactionsService.getUTxOInfo(utxoRefs, false);
Assertions.assertTrue(utxosResult.isSuccessful());
Assertions.assertNotNull(utxosResult.getValue());
log.info(utxosResult.getValue().toString());
}

@Test
void getTransactionInformationTest() throws ApiException {
String txHash = "b241c8c466c64ca7f7e33a3c4a0df5ce079a719b1c6a3b2dfe72780192235417";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import rest.koios.client.backend.api.base.Result;
import rest.koios.client.backend.api.base.common.UTxO;
import rest.koios.client.backend.api.base.exception.ApiException;
import rest.koios.client.backend.api.transactions.model.*;
import rest.koios.client.backend.factory.BackendFactory;
Expand All @@ -27,6 +28,16 @@ public void setup() {
transactionsService = BackendFactory.getKoiosPreviewService().getTransactionsService();
}

@Test
void getUTxOInfoTest() throws ApiException {
List<String> utxoRefs = List.of("206f6da5b0b0de45605a95f5ce7e172be9674550f7dde3838c45cbf24bab8b00#0",
"f1592b29b79ae85d753913dd25644c60925a4a0683979faa33832fead4b4bd9c#0");
Result<List<UTxO>> utxosResult = transactionsService.getUTxOInfo(utxoRefs, false);
Assertions.assertTrue(utxosResult.isSuccessful());
Assertions.assertNotNull(utxosResult.getValue());
log.info(utxosResult.getValue().toString());
}

@Test
void getTransactionInformationTest() throws ApiException {
String txHash = "7395c56ce76d7e6e1155ba71cc2a9dc9b37d58d162dbc1eb9fb35267bb76054d";
Expand Down

0 comments on commit 148a85b

Please sign in to comment.