/**
* The number of units of the asset being issued or spent.
*/
- private Integer amount;
+ private long amount;
/**
* The definition of the asset being issued or spent (possibly null).
/**
* The number of units of the asset being controlled.
*/
- private Integer amount;
+ private long amount;
/**
* The definition of the asset being controlled (possibly null).
req.put("alias", alias);
req.put("filter", filter);
client.request("update-transaction-feed", req);
- logger.info("update-transaction-feed");
+ logger.info("update-transaction-feed successfully");
}
/**
logger.info("list-transaction-feeds:");
logger.info("size of transactionList:" + transactionFeedList.size());
- logger.info(transactionFeedList.get(0).toJson());
-
+ for (int i =0 ;i < transactionFeedList.size();i++) {
+ logger.info(transactionFeedList.get(i).toJson());
+ }
return transactionFeedList;
}
Map<String, Object> req = new HashMap<String, Object>();
req.put("alias", alias);
client.request("delete-transaction-feed", req);
- logger.info("delete-transaction-feed");
+ logger.info("delete-transaction-feed successfully");
}
/**
* The number of units of the asset being issued or spent.
*/
- private Integer amount;
+ private long amount;
/**
* The definition of the asset being issued or spent (possibly null).
/**
* The number of units of the asset being controlled.
*/
- private Integer amount;
+ private long amount;
/**
* The definition of the asset being controlled (possibly null).
--- /dev/null
+package io.bytom.integration;
+
+import io.bytom.TestUtils;
+import io.bytom.api.TransactionFeed;
+import io.bytom.api.Wallet;
+import io.bytom.exception.BytomException;
+import io.bytom.http.Client;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.List;
+
+public class TransactionFeedTest {
+
+ static Client client;
+
+ static {
+ try {
+ client = TestUtils.generateClient();
+ } catch (BytomException e) {
+ e.printStackTrace();
+ }
+ }
+
+ static TransactionFeed transactionFeed;
+
+ @Test
+ public void testTXFeedCreate() throws Exception {
+ String filter = "asset_id='57fab05b689a2b8b6738cffb5cf6cffcd0bf6156a04b7d9ba0173e384fe38c8c' AND amount_lower_limit = 50 AND amount_upper_limit = 100";
+ String alias = "test1";
+ new TransactionFeed.Builder()
+ .setAlias(alias)
+ .setFilter(filter)
+ .create(client);
+ }
+
+ @Test
+ public void testTXFeedGet() throws Exception {
+ String alias = "test2";
+ transactionFeed = TransactionFeed.get(client, alias);
+
+ Assert.assertNotNull(transactionFeed);
+ }
+
+ @Test
+ public void testTXFeedUpdate() throws Exception {
+ String filter = "asset_id='57fab05b689a2b8b6738cffb5cf6cffcd0bf6156a04b7d9ba0173e384fe38c8c' AND amount_lower_limit = 50 AND amount_upper_limit = 100";
+ String alias = "test2";
+
+ TransactionFeed.update(client, alias, filter);
+ }
+
+ @Test
+ public void testTXFeedList() throws Exception {
+ List<TransactionFeed> txFeedList = TransactionFeed.list(client);
+ Assert.assertNotNull(txFeedList);
+ }
+
+ @Test
+ public void testTXFeedDelete() throws Exception {
+ String alias = "test2";
+ TransactionFeed.delete(client, alias);
+ }
+
+
+}
--- /dev/null
+package io.bytom.integration;
+
+import io.bytom.TestUtils;
+import io.bytom.api.UnconfirmedTransaction;
+import io.bytom.api.Wallet;
+import io.bytom.exception.BytomException;
+import io.bytom.http.Client;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class UnconfirmedTransactionTest {
+
+ static Client client;
+
+ static {
+ try {
+ client = TestUtils.generateClient();
+ } catch (BytomException e) {
+ e.printStackTrace();
+ }
+ }
+
+ static UnconfirmedTransaction unconfirmedTransaction;
+ static UnconfirmedTransaction.UTXResponse utxResponse;
+
+ @Test
+ public void testUCTXList() throws Exception {
+ utxResponse = UnconfirmedTransaction.list(client);
+ Assert.assertNotNull(utxResponse);
+ }
+
+ @Test
+ public void testUCTXGet() throws Exception {
+ utxResponse = UnconfirmedTransaction.list(client);
+ unconfirmedTransaction = UnconfirmedTransaction.get(client, utxResponse.txIds.get(0));
+ Assert.assertNotNull(unconfirmedTransaction);
+ }
+
+}