Skip to content

Commit cc1a677

Browse files
author
[a561842] Hubert Marteau
committed
suppression of not useful String.vaueOf (since usage of RPC server)
1 parent aeccd62 commit cc1a677

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>MultiChainJavaAPI</groupId>
55
<artifactId>MultiChainJavaAPI</artifactId>
6-
<version>0.4.9-SNAPSHOT</version>
6+
<version>0.4.10-SNAPSHOT</version>
77

88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/multichain/command/builders/QueryBuilderBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected Object executeListBlocks(String blockidentifiers,boolean verbose) thro
127127
* @throws MultichainException
128128
*/
129129
protected Object executeGetBlock(int height, boolean verbose) throws MultichainException {
130-
return execute(CommandEnum.GETBLOCK, String.valueOf(height), verbose);
130+
return execute(CommandEnum.GETBLOCK, height, verbose);
131131
}
132132

133133
/**
@@ -161,7 +161,7 @@ protected Object executeGetBlockCount() throws MultichainException {
161161
* @throws MultichainException
162162
*/
163163
protected Object executeGetBlockHash(long index) throws MultichainException {
164-
return execute(CommandEnum.GETBESTBLOCKHASH, String.valueOf(index));
164+
return execute(CommandEnum.GETBESTBLOCKHASH, index);
165165
}
166166

167167
}

src/main/java/multichain/command/builders/QueryBuilderRAWTransaction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ protected Object executeGetRawChangeAddress() throws MultichainException {
429429
* @throws MultichainException
430430
*/
431431
protected Object executeGetRawTransaction(String txid, int verbose) throws MultichainException {
432-
return execute(CommandEnum.GETRAWTRANSACTION, txid, String.valueOf(verbose));
432+
return execute(CommandEnum.GETRAWTRANSACTION, txid, verbose);
433433
}
434434

435435
/**

src/main/java/multichain/command/builders/QueryBuilderWalletTransaction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ protected Object executeGetTransaction(String txid, boolean includeWatchonly) th
146146
protected Object executeGetTxOut(String txid, int vout, boolean includemempool) throws MultichainException {
147147
MultichainTestParameter.isNotNullOrEmpty("txid", txid);
148148
MultichainTestParameter.valueIsPositive("vout", vout);
149-
return execute(CommandEnum.GETTXOUT, txid, String.valueOf(vout), includemempool);
149+
return execute(CommandEnum.GETTXOUT, txid, vout, includemempool);
150150
}
151151

152152
/**
@@ -384,7 +384,7 @@ protected Object executeSendFromAddress(String fromAddress, String toAddress, do
384384
MultichainTestParameter.isNotNullOrEmpty("toAddress", toAddress);
385385
MultichainTestParameter.valueIsPositive("amount", amount);
386386

387-
return execute(CommandEnum.SENDFROMADDRESS, fromAddress, toAddress, String.valueOf(amount));
387+
return execute(CommandEnum.SENDFROMADDRESS, fromAddress, toAddress, amount);
388388
}
389389

390390
/**
@@ -459,7 +459,7 @@ protected Object executeSendToAddress(String address, double amount) throws Mult
459459
MultichainTestParameter.isNotNullOrEmpty("address", address);
460460
MultichainTestParameter.valueIsPositive("amount", amount);
461461

462-
return execute(CommandEnum.SENDTOADDRESS, address, String.valueOf(amount));
462+
return execute(CommandEnum.SENDTOADDRESS, address, amount);
463463
}
464464

465465
/**
@@ -528,7 +528,7 @@ protected Object executeSendWithMetaData(String address, double amount, String h
528528
MultichainTestParameter.isNotNullOrEmpty("hexMetaData", hexMetaData);
529529
MultichainTestParameter.valueIsPositive("amount", amount);
530530

531-
return execute(CommandEnum.SENDWITHMETADATA, address, String.valueOf(amount), hexMetaData);
531+
return execute(CommandEnum.SENDWITHMETADATA, address, amount, hexMetaData);
532532
}
533533

534534
/**
@@ -609,7 +609,7 @@ protected Object executeSendWithMetaDataFrom(String fromAddress, String toAddres
609609
MultichainTestParameter.isNotNullOrEmpty("hexMetaData", hexMetaData);
610610
MultichainTestParameter.valueIsPositive("amount", amount);
611611

612-
return execute(CommandEnum.SENDWITHMETADATAFROM, fromAddress, toAddress, String.valueOf(amount), hexMetaData);
612+
return execute(CommandEnum.SENDWITHMETADATAFROM, fromAddress, toAddress, amount, hexMetaData);
613613
}
614614

615615
protected Object executeSendWithDataFrom(String fromAddress, String toAddress, String assetName, Integer assetValue, String metadata) throws MultichainException {

src/test/java/multichain/command/BlockCommandTest.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*/
88
package multichain.command;
99

10+
import java.util.List;
11+
1012
import multichain.command.MultiChainCommand;
1113
import multichain.command.MultichainException;
1214
import multichain.object.Block;
@@ -24,6 +26,16 @@ public class BlockCommandTest {
2426
public BlockCommandTest() {
2527
// TODO Auto-generated constructor stub
2628
}
29+
30+
private static void testlistBlocks() {
31+
List<Block> resultlist = multiChainCommand.getBlockCommand().listBlocksList("10-50,100",false);
32+
System.out.println("");
33+
System.out.println("resultlist size : " + resultlist.size());
34+
System.out.println("heights");
35+
for (int i =0; i<resultlist.size(); i++) {
36+
System.out.print(resultlist.get(i).getHeight()+"-");
37+
}
38+
}
2739

2840
private static void testgetBlock() {
2941
Block result = null;
@@ -103,7 +115,8 @@ public static void main(String[] args) {
103115
multiChainCommand = new MultiChainCommand("localhost", "6824", "multichainrpc",
104116
"73oYQWzx45hossFPPWUgicpLvHhsD8PempYxnSF6bnY9");
105117

106-
testgetBlock();
118+
//testgetBlock();
119+
testlistBlocks();
107120

108121
System.out.println("--- End of AddressCommandTest ---");
109122
}

0 commit comments

Comments
 (0)