mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 10:15:52 +00: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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format("pub:%s chaincode:%s path:%s", new String(HEX.encode(getPubKey())),
|
return String.format("pub:%s chaincode:%s path:%s", HEX.encode(getPubKey()),
|
||||||
new String(HEX.encode(getChainCode())), getPathAsString());
|
HEX.encode(getChainCode()), getPathAsString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class DeterministicSeed implements EncryptableItem {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public String toHexString() {
|
public String toHexString() {
|
||||||
if (unencryptedSeed != null)
|
if (unencryptedSeed != null)
|
||||||
return new String(HEX.encode(unencryptedSeed));
|
return HEX.encode(unencryptedSeed);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ public class BIP32Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String testEncode(String what) throws AddressFormatException {
|
private String testEncode(String what) throws AddressFormatException {
|
||||||
return new String(HEX.encode(Base58.decodeChecked(what)));
|
return HEX.encode(Base58.decodeChecked(what));
|
||||||
}
|
}
|
||||||
|
|
||||||
static class HDWTestVector {
|
static class HDWTestVector {
|
||||||
|
@ -122,6 +122,6 @@ public class HDUtilsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testLongToByteArray() throws Exception {
|
public void testLongToByteArray() throws Exception {
|
||||||
byte[] bytes = HDUtils.longTo4ByteArray(1026);
|
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[] seed = MnemonicCode.toSeed(code, "TREZOR");
|
||||||
byte[] entropy = mc.toEntropy(split(vecCode));
|
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(vecCode, Joiner.on(' ').join(code));
|
||||||
assertEquals(vecSeed, new String(HEX.encode(seed)));
|
assertEquals(vecSeed, HEX.encode(seed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user