Merge pull request #3224 from note-llc/master

List Noteblockhain [NTBC]
This commit is contained in:
Christoph Atteneder 2019-09-19 16:10:34 +02:00 committed by GitHub
commit 42326154d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,27 @@
/*
* 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.Coin;
import bisq.asset.RegexAddressValidator;
public class NoteBlockchain extends Coin {
public NoteBlockchain() {
super("NoteBlockchain", "NTBC", new RegexAddressValidator("^[N][a-km-zA-HJ-NP-Z1-9]{26,33}$"));
}
}

View file

@ -72,6 +72,7 @@ bisq.asset.coins.Myce
bisq.asset.coins.Namecoin
bisq.asset.coins.Navcoin
bisq.asset.coins.Noir
bisq.asset.coins.NoteBlockchain
bisq.asset.coins.ParsiCoin
bisq.asset.coins.Particl
bisq.asset.coins.PENG

View file

@ -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 NoteBlockchainTest extends AbstractAssetTest {
public NoteBlockchainTest() {
super(new NoteBlockchain());
}
@Test
public void testValidAddresses() {
assertValidAddress("NaeSp6oTDFiGBZejFyYJvuCaSqWMnMM44E");
assertValidAddress("NPCz6bsSnksLUGbp11hbHFWqFuVweEgMWM");
assertValidAddress("NMNA6oMBExWhYoVEcD2BbcL6qmQ6rs7GN2");
}
@Test
public void testInvalidAddresses() {
assertInvalidAddress("1NMNA6oMBExWhYoVEcD2BbcL6qmQ6rs7GN2");
assertInvalidAddress("NMNA6oMBExyWhYoVEcD2BbcL6qmQ6rs7GN2");
assertInvalidAddress("NMNA6oMBExWhYoVEcD2BbcL6qmQ6rs7GN2#");
}
}