Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #51 from privcycoin/list-priv-coin
Browse files Browse the repository at this point in the history
List PRiVCY (PRiV)
  • Loading branch information
cbeams committed Jun 29, 2018
2 parents 31043ad + 4100c43 commit d7af198
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/main/java/bisq/asset/coins/PRiVCY.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.Base58BitcoinAddressValidator;
import bisq.asset.Coin;
import bisq.asset.NetworkParametersAdapter;

public class PRiVCY extends Coin {

public PRiVCY() {
super("PRiVCY", "PRIV", new Base58BitcoinAddressValidator(new PRiVCYParams()));
}


public static class PRiVCYParams extends NetworkParametersAdapter {

public PRiVCYParams() {
addressHeader = 55;
p2shHeader = 78;
acceptableAddressCodes = new int[]{addressHeader, p2shHeader};
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/META-INF/services/bisq.asset.Asset
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ bisq.asset.coins.Phore
bisq.asset.coins.PIVX
bisq.asset.coins.PostCoin
bisq.asset.coins.Pranacoin
bisq.asset.coins.PRiVCY
bisq.asset.coins.ReddCoin
bisq.asset.coins.Ringo
bisq.asset.coins.Roicoin
Expand Down
43 changes: 43 additions & 0 deletions src/test/java/bisq/asset/coins/PRiVCYTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class PRiVCYTest extends AbstractAssetTest {

public PRiVCYTest() {
super(new PRiVCY());
}

@Test
public void testValidAddresses() {
assertValidAddress("PEVFjfwsjKcPTDGdbaticuuARwzb3PEUdc");
assertValidAddress("PDwYxxuVi6buPTWypE1xCY65b58yedygAt");
assertValidAddress("PMJQkfnW4nXYpaYsmFE1UMoqHeEF68kjU3");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("DEVFjfwsjKcPTDGdbaticuuARwzb3PEUdc");
assertInvalidAddress("MJJGFhcf1PSxjxRG6DMyyi188UEXJbgZcY");
assertInvalidAddress("ZMJQkfnW4nXYpaYsmFE1UMoqHeEF68kjU3");
}
}

0 comments on commit d7af198

Please sign in to comment.