Merge pull request #3396 from caraphinneth/list-ani-asset

List Animecoin (ANI)
This commit is contained in:
Christoph Atteneder 2019-10-18 10:21:17 +02:00 committed by GitHub
commit 7e4b8b7d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,36 @@
/*
* 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 Animecoin extends Coin {
public Animecoin() {
super("Animecoin", "ANI", new Base58BitcoinAddressValidator(new AnimecoinMainNetParams()));
}
public static class AnimecoinMainNetParams extends NetworkParametersAdapter {
public AnimecoinMainNetParams() {
this.addressHeader = 23;
this.p2shHeader = 9;
this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
}
}
}

View File

@ -6,6 +6,7 @@ bisq.asset.coins.Actinium
bisq.asset.coins.Adeptio
bisq.asset.coins.Aeon
bisq.asset.coins.Amitycoin
bisq.asset.coins.Animecoin
bisq.asset.coins.Arqma
bisq.asset.coins.Askcoin
bisq.asset.coins.Australiacash

View File

@ -0,0 +1,44 @@
/*
* 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 AnimecoinTest extends AbstractAssetTest {
public AnimecoinTest() {
super(new Animecoin());
}
@Test
public void testValidAddresses() {
assertValidAddress("Aa6TDuudiNh7DRzs11wEzZWiw9QBZY3Qw1");
assertValidAddress("AdsdUhnPsJwg5NvAuyxs4EsaE2GoSHohoq");
assertValidAddress("4s2peLxJJ2atz1tnAKpFshnVPKTmR312fr");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("aa6TDuudiNh7DRzs11wEzZWiw9QBZY3Qw1");
assertInvalidAddress("3s2peLxJJ2atz1tnAKpFshnVPKTmR312fr");
assertInvalidAddress("ANNPzjj2ZYEhpyJ6p6sWeH1JXbkCSmNSd#");
}
}