Skip to content

Commit

Permalink
Merge branch 'master' into 05-update-api-beta-test-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ghubstan committed Aug 4, 2021
2 parents 094bc52 + fa4238c commit 3693728
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions assets/src/main/java/bisq/asset/coins/Litecoin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@

package bisq.asset.coins;

import bisq.asset.Base58AddressValidator;
import bisq.asset.BitcoinAddressValidator;
import bisq.asset.Coin;
import bisq.asset.NetworkParametersAdapter;

public class Litecoin extends Coin {
public Litecoin() {
super("Litecoin", "LTC", new Base58AddressValidator(new LitecoinMainNetParams()), Network.MAINNET);
super("Litecoin", "LTC", new BitcoinAddressValidator(new LitecoinMainNetParams()), Network.MAINNET);
}

public static class LitecoinMainNetParams extends NetworkParametersAdapter {
public LitecoinMainNetParams() {
this.addressHeader = 48;
this.p2shHeader = 5;
this.p2shHeader = 50;
this.segwitAddressHrp = "ltc";
}
}
}
4 changes: 4 additions & 0 deletions assets/src/test/java/bisq/asset/coins/LitecoinTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ public void testValidAddresses() {
assertValidAddress("Lg3PX8wRWmApFCoCMAsPF5P9dPHYQHEWKW");
assertValidAddress("LTuoeY6RBHV3n3cfhXVVTbJbxzxnXs9ofm");
assertValidAddress("LgfapHEPhZbRF9pMd5WPT35hFXcZS1USrW");
assertValidAddress("ltc1qxtm55gultqzhqzl2p3ks50hg2478y3hehuj6dz");
assertValidAddress("MGEW4aba3tnrVtVhGcmoqqHaLt5ymPSLPi");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("1LgfapHEPhZbRF9pMd5WPT35hFXcZS1USrW");
assertInvalidAddress("LgfapHEPhZbdRF9pMd5WPT35hFXcZS1USrW");
assertInvalidAddress("LgfapHEPhZbRF9pMd5WPT35hFXcZS1USrW#");
assertInvalidAddress("bc1qxtm55gultqzhqzl2p3ks50hg2478y3hehuj6dz");
assertInvalidAddress("MGEW4aba3tnrVtVhGcmoqqHaLt5ymPSLPW");
}
}
2 changes: 2 additions & 0 deletions core/src/main/java/bisq/core/payment/PaymentAccountList.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import lombok.EqualsAndHashCode;
Expand All @@ -47,6 +48,7 @@ public Message toProtoMessage() {
public static PaymentAccountList fromProto(protobuf.PaymentAccountList proto, CoreProtoResolver coreProtoResolver) {
return new PaymentAccountList(new ArrayList<>(proto.getPaymentAccountList().stream()
.map(e -> PaymentAccount.fromProto(e, coreProtoResolver))
.filter(Objects::nonNull)
.collect(Collectors.toList())));
}
}

0 comments on commit 3693728

Please sign in to comment.