*/
public List<UnspentOutput> list(Client client) throws BytomException {
- // TODO: 2018/5/21 need to tx and test
Type listType = new ParameterizedTypeImpl(List.class, new Class[]{UnspentOutput.class});
List<UnspentOutput> unspentOutputList = client.request("list-unspent-outputs", this, listType);
logger.info("list-unspent-outputs:");
logger.info("size of unspentOutputList:" + unspentOutputList.size());
- logger.info(unspentOutputList.get(0).toJson());
+ for (UnspentOutput UTXO : unspentOutputList) {
+ logger.info(UTXO.toJson());
+ }
return unspentOutputList;
}
--- /dev/null
+package io.bytom.integration;
+
+import io.bytom.TestUtils;
+import io.bytom.api.Balance;
+import io.bytom.api.UnspentOutput;
+import io.bytom.exception.BytomException;
+import io.bytom.http.Client;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.List;
+
+public class UTXOTest {
+
+ static Client client;
+
+ static {
+ try {
+ client = TestUtils.generateClient();
+ } catch (BytomException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ @Test
+ public void testBalanceList() throws Exception {
+ List<UnspentOutput> UTXOList = new UnspentOutput.QueryBuilder().list(client);
+ Assert.assertNotNull(UTXOList);
+ }
+
+}