mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-03-25 09:02:30 +01:00
LegacyAddressTest: use BitcoinNetwork.legacyP2SHHeader() rather than NetworkParameters
This adds some validation of `BitcoinNetwork.legacyP2SHHeader()` and removes a dependency on `core`.
This commit is contained in:
parent
e2c6d2505b
commit
1903f6bc2f
1 changed files with 2 additions and 2 deletions
|
@ -161,10 +161,10 @@ public class LegacyAddressTest {
|
||||||
public void p2shAddress() {
|
public void p2shAddress() {
|
||||||
// Test that we can construct P2SH addresses
|
// Test that we can construct P2SH addresses
|
||||||
LegacyAddress mainNetP2SHAddress = LegacyAddress.fromBase58("35b9vsyH1KoFT5a5KtrKusaCcPLkiSo1tU", MAINNET);
|
LegacyAddress mainNetP2SHAddress = LegacyAddress.fromBase58("35b9vsyH1KoFT5a5KtrKusaCcPLkiSo1tU", MAINNET);
|
||||||
assertEquals(mainNetP2SHAddress.getVersion(), NetworkParameters.of(MAINNET).getP2SHHeader());
|
assertEquals(mainNetP2SHAddress.getVersion(), MAINNET.legacyP2SHHeader());
|
||||||
assertEquals(ScriptType.P2SH, mainNetP2SHAddress.getOutputScriptType());
|
assertEquals(ScriptType.P2SH, mainNetP2SHAddress.getOutputScriptType());
|
||||||
LegacyAddress testNetP2SHAddress = LegacyAddress.fromBase58("2MuVSxtfivPKJe93EC1Tb9UhJtGhsoWEHCe", TESTNET);
|
LegacyAddress testNetP2SHAddress = LegacyAddress.fromBase58("2MuVSxtfivPKJe93EC1Tb9UhJtGhsoWEHCe", TESTNET);
|
||||||
assertEquals(testNetP2SHAddress.getVersion(), NetworkParameters.of(TESTNET).getP2SHHeader());
|
assertEquals(testNetP2SHAddress.getVersion(), TESTNET.legacyP2SHHeader());
|
||||||
assertEquals(ScriptType.P2SH, testNetP2SHAddress.getOutputScriptType());
|
assertEquals(ScriptType.P2SH, testNetP2SHAddress.getOutputScriptType());
|
||||||
|
|
||||||
AddressParser parser = AddressParser.getDefault();
|
AddressParser parser = AddressParser.getDefault();
|
||||||
|
|
Loading…
Add table
Reference in a new issue