3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-11 17:55:53 +00:00

Complete rename to libdohj

This commit is contained in:
Ross Nicoll 2015-08-09 15:19:31 +01:00
parent 39fe02389b
commit 562ea4f56c
16 changed files with 70 additions and 21 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.altcoinj</groupId>
<groupId>org.libdohj</groupId>
<artifactId>libdohj</artifactId>
<version>0.14-SNAPSHOT</version>
<packaging>jar</packaging>

View File

@ -17,7 +17,7 @@
package org.bitcoinj.core;
import org.altcoinj.core.AltcoinNetworkParameters;
import org.libdohj.core.AltcoinNetworkParameters;
import com.google.common.base.Preconditions;
import javax.annotation.Nullable;
@ -28,8 +28,8 @@ import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.util.List;
import org.altcoinj.core.ScryptHash;
import static org.altcoinj.core.Utils.scryptDigest;
import org.libdohj.core.ScryptHash;
import static org.libdohj.core.Utils.scryptDigest;
import static org.bitcoinj.core.Utils.reverseBytes;

View File

@ -18,7 +18,7 @@
package org.bitcoinj.core;
import org.altcoinj.core.AltcoinNetworkParameters;
import org.libdohj.core.AltcoinNetworkParameters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -0,0 +1,24 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.bitcoinj.core;
import org.libdohj.params.DogecoinMainNetParams;
import org.bitcoinj.params.MainNetParams;
/**
*
* @author jrn
*/
public class ConvertAddress {
public static void main(final String[] argv) throws AddressFormatException {
final NetworkParameters mainParams = MainNetParams.get();
final NetworkParameters dogeParams = DogecoinMainNetParams.get();
final Address address = Address.fromBase58(mainParams, "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L");
final Address newAddress = new Address(dogeParams, 30, address.getHash160());
System.out.println(newAddress.toBase58());
}
}

View File

@ -0,0 +1,23 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.bitcoinj.core;
import org.libdohj.params.DogecoinMainNetParams;
import org.bitcoinj.params.MainNetParams;
/**
*
* @author jrn
*/
public class ConvertPrivateKey {
public static void main(final String[] argv) throws AddressFormatException {
final NetworkParameters mainParams = MainNetParams.get();
final NetworkParameters dogeParams = DogecoinMainNetParams.get();
final DumpedPrivateKey key = new DumpedPrivateKey(mainParams, "5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf");
final DumpedPrivateKey newKey = new DumpedPrivateKey(dogeParams, key.getKey().getPrivKeyBytes(), false);
System.out.println(newKey.toString());
}
}

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.altcoinj.core;
package org.libdohj.core;
import org.bitcoinj.core.Block;
import org.bitcoinj.core.Sha256Hash;

View File

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.altcoinj.core;
package org.libdohj.core;
import org.bitcoinj.core.AltcoinBlock;
import org.bitcoinj.core.BitcoinSerializer;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.altcoinj.core;
package org.libdohj.core;
import org.bitcoinj.core.Sha256Hash;
import org.bitcoinj.core.Sha256Hash;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.altcoinj.core;
package org.libdohj.core;
import com.lambdaworks.crypto.SCrypt;
import java.security.GeneralSecurityException;

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.altcoinj.params;
package org.libdohj.params;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import org.bitcoinj.core.AltcoinBlock;
import org.altcoinj.core.AltcoinNetworkParameters;
import org.libdohj.core.AltcoinNetworkParameters;
import org.bitcoinj.core.Block;
import org.bitcoinj.core.Coin;
import static org.bitcoinj.core.Coin.COIN;
@ -35,7 +35,7 @@ import org.bitcoinj.utils.MonetaryFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.altcoinj.core.AltcoinSerializer;
import org.libdohj.core.AltcoinSerializer;
import org.bitcoinj.core.Sha256Hash;
import org.bitcoinj.core.StoredBlock;
import org.bitcoinj.core.Transaction;

View File

@ -14,9 +14,9 @@
* limitations under the License.
*/
package org.altcoinj.params;
package org.libdohj.params;
import org.altcoinj.core.ScryptHash;
import org.libdohj.core.ScryptHash;
import static com.google.common.base.Preconditions.checkState;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.altcoinj.params;
package org.libdohj.params;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.Utils;

View File

@ -2,4 +2,4 @@
* Network parameters encapsulate some of the differences between different altcoin networks such as the main
* network, the testnet, regtest mode, unit testing params and so on.
*/
package org.altcoinj.params;
package org.libdohj.params;

View File

@ -2,8 +2,8 @@ package org.bitcoinj.core;
import java.util.Arrays;
import java.util.Collections;
import org.altcoinj.core.AltcoinSerializer;
import org.altcoinj.params.DogecoinMainNetParams;
import org.libdohj.core.AltcoinSerializer;
import org.libdohj.params.DogecoinMainNetParams;
import org.junit.Test;
import static org.bitcoinj.core.Util.getBytes;

View File

@ -5,9 +5,9 @@
*/
package org.bitcoinj.core;
import org.altcoinj.core.AltcoinSerializer;
import org.libdohj.core.AltcoinSerializer;
import java.io.IOException;
import org.altcoinj.params.DogecoinMainNetParams;
import org.libdohj.params.DogecoinMainNetParams;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

View File

@ -13,8 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.altcoinj.params;
package org.libdohj.params;
import org.libdohj.params.AbstractDogecoinParams;
import org.libdohj.params.DogecoinMainNetParams;
import static org.junit.Assert.assertEquals;
import org.junit.Test;