Remove some superfluous new String() calls around HEX.encode, now it has a sane API.

This commit is contained in:
Mike Hearn 2014-06-24 14:11:09 +02:00
parent 704575df1c
commit 09286a932c
5 changed files with 7 additions and 7 deletions

View File

@ -427,7 +427,7 @@ public class DeterministicKey extends ECKey {
@Override
public String toString() {
return String.format("pub:%s chaincode:%s path:%s", new String(HEX.encode(getPubKey())),
new String(HEX.encode(getChainCode())), getPathAsString());
return String.format("pub:%s chaincode:%s path:%s", HEX.encode(getPubKey()),
HEX.encode(getChainCode()), getPathAsString());
}
}

View File

@ -94,7 +94,7 @@ public class DeterministicSeed implements EncryptableItem {
@Nullable
public String toHexString() {
if (unencryptedSeed != null)
return new String(HEX.encode(unencryptedSeed));
return HEX.encode(unencryptedSeed);
else
return null;
}

View File

@ -144,7 +144,7 @@ public class BIP32Test {
}
private String testEncode(String what) throws AddressFormatException {
return new String(HEX.encode(Base58.decodeChecked(what)));
return HEX.encode(Base58.decodeChecked(what));
}
static class HDWTestVector {

View File

@ -122,6 +122,6 @@ public class HDUtilsTest {
@Test
public void testLongToByteArray() throws Exception {
byte[] bytes = HDUtils.longTo4ByteArray(1026);
Assert.assertEquals("00000402", new String(HEX.encode(bytes)));
Assert.assertEquals("00000402", HEX.encode(bytes));
}
}

View File

@ -169,9 +169,9 @@ public class MnemonicCodeTest {
byte[] seed = MnemonicCode.toSeed(code, "TREZOR");
byte[] entropy = mc.toEntropy(split(vecCode));
assertEquals(vecData, new String(HEX.encode(entropy)));
assertEquals(vecData, HEX.encode(entropy));
assertEquals(vecCode, Joiner.on(' ').join(code));
assertEquals(vecSeed, new String(HEX.encode(seed)));
assertEquals(vecSeed, HEX.encode(seed));
}
}