Skip to content

Commit

Permalink
sup divi
Browse files Browse the repository at this point in the history
  • Loading branch information
pengpengliu committed Jun 10, 2020
1 parent 1009ee4 commit ef7ebe0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/java/org/bitcorej/chain/ChainStateProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.bitcorej.chain.cosmos.CosmosStateProvider;
import org.bitcorej.chain.czz.CZZStateProvider;
import org.bitcorej.chain.dash.DashStateProvider;
import org.bitcorej.chain.divi.DIVIStateProvider;
import org.bitcorej.chain.dogecoin.DogecoinStateProvider;
import org.bitcorej.chain.eos.ABBCStateProvider;
import org.bitcorej.chain.eos.EOSStateProvider;
Expand Down Expand Up @@ -169,6 +170,9 @@ public class ChainStateProxy implements ChainState, UTXOState, USDTState, XMRSta
RVCStateProvider rvc = new RVCStateProvider(Network.MAIN);
services.put("RVC", rvc);
services.put("RVC_MAIN", rvc);
DIVIStateProvider divi = new DIVIStateProvider(Network.MAIN);
services.put("DIVI", divi);
services.put("DIVI_MAIN", divi);
}

private ChainState provider;
Expand Down
28 changes: 28 additions & 0 deletions core/src/main/java/org/bitcorej/chain/divi/DIVINetParameters.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.bitcorej.chain.divi;

import org.bitcoinj.params.AbstractBitcoinNetParams;
import org.bitcorej.chain.dash.DashNetParameters;

public class DIVINetParameters extends AbstractBitcoinNetParams {

public DIVINetParameters() {
super();
addressHeader = 30;
p2shHeader = 13;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
dumpedPrivateKeyHeader = 212;
}

private static DIVINetParameters instance;
public static synchronized DIVINetParameters get() {
if (instance == null) {
instance = new DIVINetParameters();
}
return instance;
}

@Override
public String getPaymentProtocolId() {
return "main";
}
}
11 changes: 11 additions & 0 deletions core/src/main/java/org/bitcorej/chain/divi/DIVIStateProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.bitcorej.chain.divi;

import org.bitcorej.chain.bitcoin.BitcoinStateProvider;
import org.bitcorej.core.Network;

public class DIVIStateProvider extends BitcoinStateProvider {
public DIVIStateProvider(Network network) {
super(network);
super.params = DIVINetParameters.get();
}
}

0 comments on commit ef7ebe0

Please sign in to comment.