mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-20 10:12:19 +01:00
Remove some superfluous new String() calls around HEX.encode, now it has a sane API.
This commit is contained in:
parent
704575df1c
commit
09286a932c
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user