mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 09:50:32 +01:00
org.bitcoinj.base: introduce new package that provides fundamental types with minimal dependencies
This also moves Coin, Fiat, its parent Monetary and the related MonetaryFormat into the new base package. See the provided package-info.java for details.
This commit is contained in:
parent
a4ea1f62bb
commit
84e737acdf
@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.core;
|
||||
package org.bitcoinj.base;
|
||||
|
||||
import com.google.common.math.LongMath;
|
||||
import org.bitcoinj.utils.MonetaryFormat;
|
||||
import org.bitcoinj.base.utils.MonetaryFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.core;
|
||||
package org.bitcoinj.base;
|
||||
|
||||
/**
|
||||
* Classes implementing this interface represent a monetary value, such as a Bitcoin or fiat amount.
|
29
core/src/main/java/org/bitcoinj/base/package-info.java
Normal file
29
core/src/main/java/org/bitcoinj/base/package-info.java
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright by the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The {@code base} package provides fundamental types for <b>bitcoinj</b>. These types must have
|
||||
* minimal dependencies. The criteria for allowed dependencies for {@code base} types are:
|
||||
* <ul>
|
||||
* <li>No dependencies on other packages of bitcoinj</li>
|
||||
* <li>No API dependencies on external libraries other than the core JDK</li>
|
||||
* <li>Implementation dependencies on Guava are allowed for now (but should be avoided as much as possible)</li>
|
||||
* </ul>
|
||||
* The base package will help us make bitcoinj more modular as we will use it to break circular dependencies
|
||||
* between existing packages. We are also considering splitting {@code base} into a separate JAR/module in a
|
||||
* future release.
|
||||
*/
|
||||
package org.bitcoinj.base;
|
@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
package org.bitcoinj.base.utils;
|
||||
|
||||
import com.google.common.math.LongMath;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.core.Monetary;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.base.Monetary;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Objects;
|
@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
package org.bitcoinj.base.utils;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.core.Monetary;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.base.Monetary;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormatSymbols;
|
@ -19,6 +19,7 @@ package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.internal.InternalUtils;
|
||||
import org.bitcoinj.params.AbstractBitcoinNetParams;
|
||||
import org.bitcoinj.script.Script;
|
||||
@ -41,7 +42,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.core.Sha256Hash.hashTwice;
|
||||
|
||||
/**
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.utils.ContextPropagatingThreadFactory;
|
||||
import org.bitcoinj.wallet.SendRequest;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.params.AbstractBitcoinNetParams;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.Script.VerifyFlag;
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.params.MainNetParams;
|
||||
import org.bitcoinj.params.RegTestParams;
|
||||
import org.bitcoinj.params.SigNetParams;
|
||||
@ -25,7 +26,7 @@ import org.bitcoinj.params.UnitTestParams;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.store.BlockStore;
|
||||
import org.bitcoinj.store.BlockStoreException;
|
||||
import org.bitcoinj.utils.MonetaryFormat;
|
||||
import org.bitcoinj.base.utils.MonetaryFormat;
|
||||
import org.bitcoinj.utils.VersionTally;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -35,7 +36,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
|
||||
/**
|
||||
* <p>NetworkParameters contains the data needed for working with an instantiation of a Bitcoin chain.</p>
|
||||
|
@ -21,6 +21,7 @@ import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.base.Throwables;
|
||||
import net.jcip.annotations.GuardedBy;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.listeners.BlocksDownloadedEventListener;
|
||||
import org.bitcoinj.core.listeners.ChainDownloadStartedEventListener;
|
||||
import org.bitcoinj.core.listeners.GetDataEventListener;
|
||||
|
@ -20,6 +20,7 @@ package org.bitcoinj.core;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.math.IntMath;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.TransactionConfidence.ConfidenceType;
|
||||
import org.bitcoinj.crypto.TransactionSignature;
|
||||
import org.bitcoinj.script.Script;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.internal.InternalUtils;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.ScriptException;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.ScriptBuilder;
|
||||
import org.bitcoinj.script.ScriptException;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.script.Script;
|
||||
|
||||
import java.io.EOFException;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.jni;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
import org.bitcoinj.wallet.listeners.WalletCoinsReceivedEventListener;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.jni;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
import org.bitcoinj.wallet.listeners.WalletCoinsSentEventListener;
|
||||
|
@ -20,7 +20,7 @@ package org.bitcoinj.params;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import org.bitcoinj.core.BitcoinSerializer;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.Sha256Hash;
|
||||
import org.bitcoinj.core.StoredBlock;
|
||||
@ -30,7 +30,7 @@ import org.bitcoinj.core.Utils;
|
||||
import org.bitcoinj.core.VerificationException;
|
||||
import org.bitcoinj.store.BlockStore;
|
||||
import org.bitcoinj.store.BlockStoreException;
|
||||
import org.bitcoinj.utils.MonetaryFormat;
|
||||
import org.bitcoinj.base.utils.MonetaryFormat;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -22,7 +22,7 @@ import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import org.bitcoin.protocols.payments.Protos;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.Utils;
|
||||
|
@ -21,7 +21,7 @@ import com.google.common.util.concurrent.ListeningExecutorService;
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import org.bitcoin.protocols.payments.Protos;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.TransactionOutput;
|
||||
|
@ -20,7 +20,7 @@
|
||||
package org.bitcoinj.script;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
package org.bitcoinj.signers;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.TransactionInput;
|
||||
|
@ -20,7 +20,7 @@ package org.bitcoinj.store;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
@ -20,7 +20,7 @@ package org.bitcoinj.testing;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
import org.bitcoinj.core.MessageSerializer;
|
||||
@ -46,8 +46,8 @@ import java.nio.ByteBuffer;
|
||||
import java.util.Random;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
|
||||
/**
|
||||
* Methods for building fake transactions for unit tests. Since these methods are currently used both in the `bitcoinj-core`
|
||||
|
@ -18,7 +18,7 @@ package org.bitcoinj.uri;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.AddressFormatException;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.params.AbstractBitcoinNetParams;
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.text.DecimalFormat;
|
||||
@ -27,7 +29,7 @@ import java.util.Locale;
|
||||
import static java.math.BigDecimal.ONE;
|
||||
import static java.math.BigDecimal.ZERO;
|
||||
import static java.math.RoundingMode.HALF_UP;
|
||||
import static org.bitcoinj.core.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
import static org.bitcoinj.base.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
|
||||
/**
|
||||
* <p>This class, a concrete extension of {@link BtcFormat}, is distinguished by its
|
||||
@ -52,7 +54,7 @@ import static org.bitcoinj.core.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
* @see java.text.NumberFormat
|
||||
* @see java.text.DecimalFormat
|
||||
* @see DecimalFormatSymbols
|
||||
* @see org.bitcoinj.core.Coin
|
||||
* @see Coin
|
||||
*/
|
||||
|
||||
public final class BtcAutoFormat extends BtcFormat {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.text.DecimalFormat;
|
||||
@ -27,7 +27,7 @@ import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static org.bitcoinj.core.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
import static org.bitcoinj.base.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
|
||||
/**
|
||||
* <p>This class, a concrete extension of {@link BtcFormat}, is distinguished in that each
|
||||
|
@ -17,7 +17,7 @@
|
||||
package org.bitcoinj.utils;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.utils.BtcAutoFormat.Style;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -16,7 +16,8 @@
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.utils.Fiat;
|
||||
import org.bitcoinj.base.Coin;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Objects;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.wallet;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.TransactionOutput;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.wallet;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.TransactionOutput;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -17,7 +17,7 @@
|
||||
package org.bitcoinj.wallet;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.TransactionConfidence;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.wallet;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.TransactionInput;
|
||||
import org.bitcoinj.core.TransactionOutPoint;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
package org.bitcoinj.wallet;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.TransactionConfidence;
|
||||
|
@ -20,7 +20,7 @@ package org.bitcoinj.wallet;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import org.bitcoin.protocols.payments.Protos.PaymentDetails;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
@ -29,7 +29,7 @@ import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Base58;
|
||||
import org.bitcoinj.core.BlockChain;
|
||||
import org.bitcoinj.core.BloomFilter;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.FilteredBlock;
|
||||
|
@ -21,7 +21,7 @@ import com.google.protobuf.ByteString;
|
||||
import com.google.protobuf.CodedInputStream;
|
||||
import com.google.protobuf.CodedOutputStream;
|
||||
import com.google.protobuf.WireFormat;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.PeerAddress;
|
||||
import org.bitcoinj.core.Sha256Hash;
|
||||
@ -37,7 +37,7 @@ import org.bitcoinj.crypto.KeyCrypterScrypt;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.ScriptException;
|
||||
import org.bitcoinj.utils.ExchangeRate;
|
||||
import org.bitcoinj.utils.Fiat;
|
||||
import org.bitcoinj.base.utils.Fiat;
|
||||
import org.bitcoinj.wallet.Protos.Wallet.EncryptionType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.wallet.listeners;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.core.TransactionConfidence;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.wallet.listeners;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
|
||||
|
@ -14,24 +14,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.core;
|
||||
package org.bitcoinj.base;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.core.Coin.NEGATIVE_SATOSHI;
|
||||
import static org.bitcoinj.core.Coin.SATOSHI;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.core.Coin.btcToSatoshi;
|
||||
import static org.bitcoinj.core.Coin.parseCoin;
|
||||
import static org.bitcoinj.core.Coin.parseCoinInexact;
|
||||
import static org.bitcoinj.core.Coin.satoshiToBtc;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.NEGATIVE_SATOSHI;
|
||||
import static org.bitcoinj.base.Coin.SATOSHI;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.btcToSatoshi;
|
||||
import static org.bitcoinj.base.Coin.parseCoin;
|
||||
import static org.bitcoinj.base.Coin.parseCoinInexact;
|
||||
import static org.bitcoinj.base.Coin.satoshiToBtc;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.bitcoinj.core.NetworkParameters.MAX_MONEY;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
package org.bitcoinj.base.utils;
|
||||
|
||||
import org.bitcoinj.base.utils.Fiat;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.bitcoinj.utils.Fiat.parseFiat;
|
||||
import static org.bitcoinj.base.utils.Fiat.parseFiat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -14,19 +14,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
package org.bitcoinj.base.utils;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.utils.Fiat;
|
||||
import org.bitcoinj.base.utils.MonetaryFormat;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.SATOSHI;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.SATOSHI;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class MonetaryFormatTest {
|
@ -18,6 +18,7 @@
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.params.MainNetParams;
|
||||
import org.bitcoinj.params.UnitTestParams;
|
||||
import org.bitcoinj.script.Script;
|
||||
@ -40,7 +41,7 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.params.MainNetParams;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
import org.bitcoinj.params.UnitTestParams;
|
||||
@ -39,10 +40,10 @@ import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeBlock;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -18,6 +18,7 @@
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.io.ByteStreams;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.AbstractBlockChain.NewBlockType;
|
||||
import org.bitcoinj.params.MainNetParams;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.TransactionConfidence.ConfidenceType;
|
||||
import org.bitcoinj.params.UnitTestParams;
|
||||
import org.bitcoinj.script.Script;
|
||||
@ -40,11 +41,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -17,6 +17,7 @@
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Transaction.SigHash;
|
||||
import org.bitcoinj.crypto.TransactionSignature;
|
||||
import org.bitcoinj.script.Script;
|
||||
@ -44,9 +45,9 @@ import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.core.Coin.SATOSHI;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.SATOSHI;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.bitcoinj.script.ScriptOpCodes.OP_1;
|
||||
import static org.bitcoinj.script.ScriptOpCodes.OP_2DUP;
|
||||
import static org.bitcoinj.script.ScriptOpCodes.OP_CHECKMULTISIG;
|
||||
|
@ -29,8 +29,8 @@ import org.junit.Test;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.bitcoinj.core.Utils.HEX;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeBlock;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
|
@ -17,6 +17,7 @@
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.params.UnitTestParams;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.ScriptBuilder;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.script.Script;
|
||||
import org.bitcoinj.script.ScriptBuilder;
|
||||
import org.bitcoinj.script.ScriptPattern;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.TransactionConfidence.ConfidenceType;
|
||||
import org.bitcoinj.crypto.TransactionSignature;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
|
@ -25,7 +25,7 @@ import org.junit.Test;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.easymock.EasyMock.anyObject;
|
||||
import static org.easymock.EasyMock.createMock;
|
||||
import static org.easymock.EasyMock.expect;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.script.ScriptBuilder;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
package org.bitcoinj.params;
|
||||
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -21,7 +21,7 @@ import org.bitcoin.protocols.payments.Protos.Payment;
|
||||
import org.bitcoin.protocols.payments.Protos.PaymentACK;
|
||||
import org.bitcoin.protocols.payments.Protos.PaymentRequest;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
@ -20,7 +20,7 @@ package org.bitcoinj.protocols.payments;
|
||||
import com.google.protobuf.ByteString;
|
||||
import org.bitcoin.protocols.payments.Protos;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
@ -44,7 +44,7 @@ import java.util.Date;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
@ -22,7 +22,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.DumpedPrivateKey;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
|
@ -23,7 +23,7 @@ import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.BlockChain;
|
||||
import org.bitcoinj.core.BlockTest;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
@ -71,8 +71,8 @@ import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -20,7 +20,7 @@ import org.bitcoinj.core.AbstractBlockChain;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.BlockChain;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
@ -28,8 +28,8 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.parseCoin;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.parseCoin;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@ -43,12 +43,12 @@ import static java.util.Locale.ITALY;
|
||||
import static java.util.Locale.JAPAN;
|
||||
import static java.util.Locale.TAIWAN;
|
||||
import static java.util.Locale.US;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.SATOSHI;
|
||||
import static org.bitcoinj.core.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.core.Coin.parseCoin;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.SATOSHI;
|
||||
import static org.bitcoinj.base.Coin.SMALLEST_UNIT_EXPONENT;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.parseCoin;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.bitcoinj.core.NetworkParameters.MAX_MONEY;
|
||||
import static org.bitcoinj.utils.BtcAutoFormat.Style.CODE;
|
||||
import static org.bitcoinj.utils.BtcAutoFormat.Style.SYMBOL;
|
||||
|
@ -16,7 +16,8 @@
|
||||
|
||||
package org.bitcoinj.utils;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.utils.Fiat;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -18,7 +18,7 @@ package org.bitcoinj.wallet;
|
||||
|
||||
import org.bitcoinj.core.AbstractBlockChain;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.PeerAddress;
|
||||
import org.bitcoinj.core.Transaction;
|
||||
@ -39,8 +39,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
package org.bitcoinj.wallet;
|
||||
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
@ -41,7 +41,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.script.ScriptOpCodes.OP_PUSHDATA1;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
@ -22,7 +22,7 @@ import org.bitcoinj.core.AbstractBlockChain;
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Block;
|
||||
import org.bitcoinj.core.BlockChain;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.InsufficientMoneyException;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
@ -60,7 +60,7 @@ import org.bitcoinj.testing.MockTransactionBroadcaster;
|
||||
import org.bitcoinj.testing.NopTransactionSigner;
|
||||
import org.bitcoinj.testing.TestWithWallet;
|
||||
import org.bitcoinj.utils.ExchangeRate;
|
||||
import org.bitcoinj.utils.Fiat;
|
||||
import org.bitcoinj.base.utils.Fiat;
|
||||
import org.bitcoinj.utils.Threading;
|
||||
import org.bitcoinj.wallet.KeyChain.KeyPurpose;
|
||||
import org.bitcoinj.wallet.Protos.Wallet.EncryptionType;
|
||||
@ -94,12 +94,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.MILLICOIN;
|
||||
import static org.bitcoinj.core.Coin.SATOSHI;
|
||||
import static org.bitcoinj.core.Coin.ZERO;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.MILLICOIN;
|
||||
import static org.bitcoinj.base.Coin.SATOSHI;
|
||||
import static org.bitcoinj.base.Coin.ZERO;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.bitcoinj.core.Utils.HEX;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeBlock;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
|
@ -28,7 +28,7 @@ import org.bitcoinj.wallet.Wallet;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static org.bitcoinj.core.Coin.*;
|
||||
import static org.bitcoinj.base.Coin.*;
|
||||
|
||||
/**
|
||||
* This is a little test app that waits for a coin on a local regtest node, then generates two transactions that double
|
||||
|
@ -18,7 +18,7 @@
|
||||
package org.bitcoinj.examples;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.InsufficientMoneyException;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
|
@ -26,7 +26,7 @@ import java.util.EnumSet;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.SignatureDecodeException;
|
||||
|
@ -18,7 +18,7 @@
|
||||
package org.bitcoinj.examples;
|
||||
|
||||
import org.bitcoinj.core.AddressMessage;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.NetworkParameters;
|
||||
import org.bitcoinj.core.Peer;
|
||||
import org.bitcoinj.core.PeerGroup;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.examples;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.*;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
import org.bitcoinj.store.BlockStore;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.examples;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.*;
|
||||
import org.bitcoinj.kits.WalletAppKit;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.TransactionConfidence.ConfidenceType;
|
||||
import org.bitcoinj.store.MemoryBlockStore;
|
||||
import org.bitcoinj.testing.FakeTxBuilder;
|
||||
|
@ -19,6 +19,7 @@ package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.listeners.DownloadProgressTracker;
|
||||
import org.bitcoinj.core.listeners.PeerConnectedEventListener;
|
||||
import org.bitcoinj.core.listeners.PeerDisconnectedEventListener;
|
||||
@ -61,8 +62,8 @@ import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
@ -18,6 +18,7 @@ package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.util.concurrent.Uninterruptibles;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.listeners.BlocksDownloadedEventListener;
|
||||
import org.bitcoinj.core.listeners.PreMessageReceivedEventListener;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
@ -51,8 +52,8 @@ import java.util.concurrent.Future;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeBlock;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.createFakeTx;
|
||||
import static org.bitcoinj.testing.FakeTxBuilder.makeSolvedTestBlock;
|
||||
|
@ -37,10 +37,10 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.bitcoinj.core.Coin.CENT;
|
||||
import static org.bitcoinj.core.Coin.COIN;
|
||||
import static org.bitcoinj.core.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.core.Coin.valueOf;
|
||||
import static org.bitcoinj.base.Coin.CENT;
|
||||
import static org.bitcoinj.base.Coin.COIN;
|
||||
import static org.bitcoinj.base.Coin.FIFTY_COINS;
|
||||
import static org.bitcoinj.base.Coin.valueOf;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
@ -19,7 +19,7 @@ package org.bitcoinj.testing;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.BlockChain;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
import org.bitcoinj.core.LegacyAddress;
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package org.bitcoinj.tools;
|
||||
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.*;
|
||||
import org.bitcoinj.core.listeners.PeerConnectedEventListener;
|
||||
import org.bitcoinj.core.listeners.PeerDisconnectedEventListener;
|
||||
|
@ -17,7 +17,7 @@
|
||||
package org.bitcoinj.walletfx.utils;
|
||||
|
||||
import org.bitcoinj.core.Address;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.listeners.DownloadProgressTracker;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
import javafx.application.Platform;
|
||||
|
@ -23,8 +23,8 @@ import javafx.scene.Scene;
|
||||
import javafx.scene.input.KeyCombination;
|
||||
import javafx.scene.layout.Pane;
|
||||
import org.bitcoinj.core.listeners.DownloadProgressTracker;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.utils.MonetaryFormat;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.base.utils.MonetaryFormat;
|
||||
import javafx.animation.FadeTransition;
|
||||
import javafx.animation.ParallelTransition;
|
||||
import javafx.animation.TranslateTransition;
|
||||
|
@ -17,6 +17,7 @@
|
||||
package wallettemplate;
|
||||
|
||||
import javafx.scene.layout.HBox;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.*;
|
||||
import org.bitcoinj.wallet.SendRequest;
|
||||
import org.bitcoinj.wallet.Wallet;
|
||||
|
@ -47,7 +47,7 @@ import org.bitcoinj.core.AddressFormatException;
|
||||
import org.bitcoinj.core.Base58;
|
||||
import org.bitcoinj.core.BlockChain;
|
||||
import org.bitcoinj.core.CheckpointManager;
|
||||
import org.bitcoinj.core.Coin;
|
||||
import org.bitcoinj.base.Coin;
|
||||
import org.bitcoinj.core.Context;
|
||||
import org.bitcoinj.core.DumpedPrivateKey;
|
||||
import org.bitcoinj.core.ECKey;
|
||||
@ -108,7 +108,7 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.bitcoinj.core.Coin.parseCoin;
|
||||
import static org.bitcoinj.base.Coin.parseCoin;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user