This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from wqking/master
* wqking-master: Wrap code at 120 characters (bisq-network/style#3) List InstaCash (ICH)
- Loading branch information
Showing
5 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
src/main/java/bisq/core/payment/validation/params/ICHParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* | ||
* 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.core.payment.validation.params; | ||
|
||
import org.bitcoinj.core.BitcoinSerializer; | ||
import org.bitcoinj.core.Block; | ||
import org.bitcoinj.core.Coin; | ||
import org.bitcoinj.core.NetworkParameters; | ||
import org.bitcoinj.core.StoredBlock; | ||
import org.bitcoinj.core.VerificationException; | ||
import org.bitcoinj.store.BlockStore; | ||
import org.bitcoinj.store.BlockStoreException; | ||
import org.bitcoinj.utils.MonetaryFormat; | ||
|
||
public class ICHParams extends NetworkParameters { | ||
|
||
private static ICHParams instance; | ||
|
||
public static synchronized ICHParams get() { | ||
if (instance == null) { | ||
instance = new ICHParams(); | ||
} | ||
return instance; | ||
} | ||
|
||
// We only use the properties needed for address validation | ||
public ICHParams() { | ||
super(); | ||
addressHeader = 23; | ||
p2shHeader = 13; | ||
acceptableAddressCodes = new int[]{addressHeader, p2shHeader}; | ||
} | ||
|
||
// default dummy implementations, not used... | ||
@Override | ||
public String getPaymentProtocolId() { | ||
return PAYMENT_PROTOCOL_ID_MAINNET; | ||
} | ||
|
||
@Override | ||
public void checkDifficultyTransitions(StoredBlock storedPrev, Block next, BlockStore blockStore) | ||
throws VerificationException, BlockStoreException { | ||
} | ||
|
||
@Override | ||
public Coin getMaxMoney() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Coin getMinNonDustOutput() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public MonetaryFormat getMonetaryFormat() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getUriScheme() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean hasMaxMoney() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public BitcoinSerializer getSerializer(boolean parseRetain) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int getProtocolVersionNum(ProtocolVersion version) { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters