AddressTest: Fix cast.

This commit is contained in:
Andreas Schildbach
2018-02-19 10:37:30 +01:00
parent b559609f7b
commit 335a8e9fd3

View File

@@ -43,15 +43,15 @@ public class AddressTest {
Address testAddress = Address.fromBase58(testParams, "n4eA2nbYqErp7H6jebchxAN59DmNpksexv");
ByteArrayOutputStream os = new ByteArrayOutputStream();
new ObjectOutputStream(os).writeObject(testAddress);
VersionedChecksummedBytes testAddressCopy = (VersionedChecksummedBytes) new ObjectInputStream(
new ByteArrayInputStream(os.toByteArray())).readObject();
Address testAddressCopy = (Address) new ObjectInputStream(new ByteArrayInputStream(os.toByteArray()))
.readObject();
assertEquals(testAddress, testAddressCopy);
Address mainAddress = Address.fromBase58(mainParams, "17kzeh4N8g49GFvdDzSf8PjaPfyoD1MndL");
os = new ByteArrayOutputStream();
new ObjectOutputStream(os).writeObject(mainAddress);
VersionedChecksummedBytes mainAddressCopy = (VersionedChecksummedBytes) new ObjectInputStream(
new ByteArrayInputStream(os.toByteArray())).readObject();
Address mainAddressCopy = (Address) new ObjectInputStream(new ByteArrayInputStream(os.toByteArray()))
.readObject();
assertEquals(mainAddress, mainAddressCopy);
}