[bisq-network/bisq] List Ndau (XND) (#3110)
Bernard Labno
notifications at github.com
Mon Sep 30 04:48:18 UTC 2019
blabno requested changes on this pull request.
NACK per comments.
Squash commits into one, keeping proper commit message.
> +
+package bisq.asset.coins;
+
+import bisq.asset.AddressValidationResult;
+import bisq.asset.AddressValidator;
+import bisq.asset.Coin;
+import bisq.asset.RegexAddressValidator;
+
+
+public class Ndau extends Coin {
+
+ // note: ndau addresses contain an internal checksum which was deemed too complicated to include here.
+ // this regex performs superficial validation, but there is a large space of addresses marked valid
+ // by this regex which are not in fact valid ndau addresses. For actual ndau address validation,
+ // use the Address class in github.com/oneiro-ndev/ndauj (java) or github.com/oneiro-ndev/ndaumath/pkg/address (go).
+ private static AddressValidator validator = new RegexAddressValidator("nd[anexbm][abcdefghijkmnpqrstuvwxyz23456789]{45}");
There is no need to make this an object property. Move validator instantiation and declaration into constructor.
> +import bisq.asset.AddressValidationResult;
+import bisq.asset.AddressValidator;
+import bisq.asset.Coin;
+import bisq.asset.RegexAddressValidator;
+
+
+public class Ndau extends Coin {
+
+ // note: ndau addresses contain an internal checksum which was deemed too complicated to include here.
+ // this regex performs superficial validation, but there is a large space of addresses marked valid
+ // by this regex which are not in fact valid ndau addresses. For actual ndau address validation,
+ // use the Address class in github.com/oneiro-ndev/ndauj (java) or github.com/oneiro-ndev/ndaumath/pkg/address (go).
+ private static AddressValidator validator = new RegexAddressValidator("nd[anexbm][abcdefghijkmnpqrstuvwxyz23456789]{45}");
+
+ public Ndau() {
+ super("ndau", "XND", Ndau.validator, Network.MAINNET);
Mainnet is the default value, so no need for that parameter.
> +import bisq.asset.AddressValidationResult;
+import bisq.asset.AddressValidator;
+import bisq.asset.Coin;
+import bisq.asset.RegexAddressValidator;
+
+
+public class Ndau extends Coin {
+
+ // note: ndau addresses contain an internal checksum which was deemed too complicated to include here.
+ // this regex performs superficial validation, but there is a large space of addresses marked valid
+ // by this regex which are not in fact valid ndau addresses. For actual ndau address validation,
+ // use the Address class in github.com/oneiro-ndev/ndauj (java) or github.com/oneiro-ndev/ndaumath/pkg/address (go).
+ private static AddressValidator validator = new RegexAddressValidator("nd[anexbm][abcdefghijkmnpqrstuvwxyz23456789]{45}");
+
+ public Ndau() {
+ super("ndau", "XND", Ndau.validator, Network.MAINNET);
Name of asset should be uppercased I guess.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3110#pullrequestreview-294748233
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190929/30f841f9/attachment.html>
More information about the bisq-github
mailing list