Skip to content

Commit

Permalink
Package rename
Browse files Browse the repository at this point in the history
  • Loading branch information
koh-gt committed Aug 14, 2024
1 parent c3ec25f commit d7e88cb
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 79 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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>
<parent>
<groupId>org.bitcoinj</groupId>
<groupId>org.ferritej</groupId>
<artifactId>ferritej-parent</artifactId>
<version>0.14.2</version>
</parent>
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/org/bitcoinj/core/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,26 +91,26 @@ public int compare(final Transaction tx1, final Transaction tx2) {
/** Same but as a BigInteger for CHECKLOCKTIMEVERIFY */
public static final BigInteger LOCKTIME_THRESHOLD_BIG = BigInteger.valueOf(LOCKTIME_THRESHOLD);

/** How many bytes a transaction can be before it won't be relayed anymore. Currently 100kb. */
public static final int MAX_STANDARD_TX_SIZE = 100000;
/** How many bytes a transaction can be before it won't be relayed anymore. Currently 1mb. */
public static final int MAX_STANDARD_TX_SIZE = 1000000;

/**
* If feePerKb is lower than this, Bitcoin Core will treat it as if there were no fee.
*/
public static final Coin REFERENCE_DEFAULT_MIN_TX_FEE = Coin.valueOf(5000); // 0.05 mBTC
public static final Coin REFERENCE_DEFAULT_MIN_TX_FEE = Coin.valueOf(2000); // 0.02 mFEC

/**
* If using this feePerKb, transactions will get confirmed within the next couple of blocks.
* This should be adjusted from time to time. Last adjustment: March 2016.
*/
public static final Coin DEFAULT_TX_FEE = Coin.valueOf(50000); // 0.5 mBTC
public static final Coin DEFAULT_TX_FEE = Coin.valueOf(10000); // 0.1 mFEC

/**
* Any standard (ie pay-to-address) output smaller than this value (in satoshis) will most likely be rejected by the network.
* This is calculated by assuming a standard output will be 34 bytes, and then using the formula used in
* {@link TransactionOutput#getMinNonDustValue(Coin)}.
*/
public static final Coin MIN_NONDUST_OUTPUT = Coin.valueOf(2730); // satoshis
public static final Coin MIN_NONDUST_OUTPUT = Coin.valueOf(1000); // originally 2730 atoms

// These are bitcoin serialized.
private long version;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/params/MainNetParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public MainNetParams() {
interval = INTERVAL;
targetTimespan = TARGET_TIMESPAN;
maxTarget = Utils.decodeCompactBits(0x1e00ffffL);
dumpedPrivateKeyHeader = 128;
dumpedPrivateKeyHeader = 128 + 111;
addressHeader = 36;
p2shHeader = 5;
acceptableAddressCodes = new int[] { addressHeader, p2shHeader };
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/uri/BitcoinURI.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public BitcoinURI(@Nullable NetworkParameters params, String input) throws Bitco
// Split off the address from the rest of the query parameters.
String[] addressSplitTokens = schemeSpecificPart.split("\\?", 2);
if (addressSplitTokens.length == 0)
throw new BitcoinURIParseException("No data found after the bitcoin: prefix");
throw new BitcoinURIParseException("No data found after the ferrite: prefix");
String addressToken = addressSplitTokens[0]; // may be empty!

String[] nameValuePairTokens;
Expand Down
76 changes: 38 additions & 38 deletions core/src/main/java/org/bitcoinj/utils/BtcFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
*
* <blockquote><pre>
* BtcFormat f = BtcFormat.getInstance();
* String c = f.format(Coin.COIN); <strong>// "BTC 1.00"</strong>
* String k = f.format(Coin.COIN.multiply(1000)); <strong>// "BTC 1,000.00"</strong>
* String m = f.format(Coin.COIN.divide(1000)); <strong>// "mBTC 1.00"</strong>
* String c = f.format(Coin.COIN); <strong>// "FEC 1.00"</strong>
* String k = f.format(Coin.COIN.multiply(1000)); <strong>// "FEC 1,000.00"</strong>
* String m = f.format(Coin.COIN.divide(1000)); <strong>// "mFEC 1.00"</strong>
* Coin all = f.parseObject("M฿ 21"); <strong>// All the money in the world</strong>
* </pre></blockquote>
*
Expand All @@ -97,15 +97,15 @@
* values of {@link BtcAutoFormat.Style}. There are two styles constants: {@link
* BtcAutoFormat.Style#CODE} (the default), and {@link BtcAutoFormat.Style#SYMBOL}. The
* difference is that the <code>CODE</code> style uses an internationally-distinct currency
* code, such as <code>"BTC"</code>, to indicate the units of denomination, while the
* code, such as <code>"FEC"</code>, to indicate the units of denomination, while the
* <code>SYMBOL</code> style uses a possibly-ambiguous currency symbol such as
* <code>"฿"</code>.
*
* <p>The denomination used when formatting will be either bitcoin, millicoin
* or microcoin, depending on the value being represented, chosen so as to minimize the number
* <p>The denomination used when formatting will be either ferritecoin, milliferrite
* or microferrite, depending on the value being represented, chosen so as to minimize the number
* of consecutive zeros displayed without losing precision. For example, depending on the
* locale, a value of one bitcoin might be formatted as <pre>฿1.00</pre> where a value
* exceeding that by one satoshi would be <pre>µ฿1,000,000.01</pre>
* locale, a value of one ferritecoin might be formatted as <pre>฿1.00</pre> where a value
* exceeding that by one atom would be <pre>µ฿1,000,000.01</pre>
*
* <h5>Fixed Denomination</h5>
*
Expand All @@ -114,9 +114,9 @@
* defined by its scale, which is the number of places one must shift the decimal point in
* increasing precision to convert the representation of a given quantity of bitcoins into a
* representation of the same value denominated in the formatter's units. For example, a scale
* value of <code>3</code> specifies a denomination of millibitcoins, because to represent
* <code>1.0000 BTC</code>, or one bitcoin, in millibitcoins, one shifts the decimal point
* three places, that is, to <code>1000.0 mBTC</code>.
* value of <code>3</code> specifies a denomination of milliferrites, because to represent
* <code>1.00000000 FEC</code>, or one ferritecoin, in milliferrites, one shifts the decimal point
* three places, that is, to <code>1000.00000 mFEC</code>.
*
* <h3>Construction</h3>
*
Expand Down Expand Up @@ -148,7 +148,7 @@
*
* <blockquote><pre>
* BtcFormat f = BtcFormat.getInstance();
* String s = f.format(Coin.COIN); <strong>// "BTC 1.00"</strong>
* String s = f.format(Coin.COIN); <strong>// "FEC 1.00"</strong>
* </pre></blockquote>
*
* <p>The first argument to <code>getInstance()</code> can determine
Expand All @@ -157,7 +157,7 @@
* of that <code>int</code> will be interpreted as the decimal-place scale of
* the {@link BtcFixedFormat} instance that is returned, and thus will
* determine its denomination. For example, if you want to format
* values in units of microbitcoins:
* values in units of microferritecoins:
*
* <blockquote><pre>BtcFormat m = BtcFormat.getInstance(6);
*String s = m.format(Coin.COIN); <strong>// "1,000,000.00"</strong>
Expand Down Expand Up @@ -196,7 +196,7 @@
* is an optional <code>Locale</code> value.
*
* For example, here we construct four instances for the same locale that each format
* differently the same one-bitcoin value:
* differently the same one-ferritecoin value:
*
* <blockquote><pre>
* <strong>// Next line returns "1,00 BTC"</strong>
Expand Down Expand Up @@ -264,7 +264,7 @@
* method. This argument can be either a {@link org.bitcoinj.core.Coin}-type object or a
* numerical object such as {@link java.lang.Long} or {@link java.math.BigDecimal}.
* Integer-based types such as {@link java.math.BigInteger} are interpreted as representing a
* number of satoshis, while a {@link java.math.BigDecimal} is interpreted as representing a
* number of atoms, while a {@link java.math.BigDecimal} is interpreted as representing a
* number of bitcoins. A value having a fractional amount of satoshis is rounded to the
* nearest whole satoshi at least, and possibly to a greater unit depending on the number of
* fractional decimal-places displayed. The <code>format()</code> method will not accept an
Expand Down Expand Up @@ -425,7 +425,7 @@
* parsed <code>String</code>s.
*
* <p>When parsing, if the currency-units indicator is absent, then a {@link BtcAutoFormat}
* instance will infer a denomination of bitcoins while a {@link BtcFixedFormat} will infer the
* instance will infer a denomination of ferritecoins while a {@link BtcFixedFormat} will infer the
* denomination in which it expresses formatted values. Note: by default (unless overridden by
* a custom pattern), if the locale or style requires a space to separate the number from the
* units indicator, that space must be present in the String to be parsed, even if the units
Expand Down Expand Up @@ -493,12 +493,12 @@ public abstract class BtcFormat extends Format {
* comparisons.
*/

/** The conventional international currency code for bitcoins: "BTC" */
private static final String COIN_CODE = "BTC";
/** The conventional international currency code for ferritecoins: "FEC" */
private static final String COIN_CODE = "FEC";
/** The default currency symbols for bitcoins */
private static final String COIN_SYMBOL = "฿";
private static final String COIN_SYMBOL = "F";
/** An alternative currency symbol to use in locales where the default symbol is used for the national currency. */
protected static final String COIN_SYMBOL_ALT = "Ƀ";
protected static final String COIN_SYMBOL_ALT = "F";

protected final DecimalFormat numberFormat; // warning: mutable
protected final int minimumFractionDigits;
Expand Down Expand Up @@ -954,7 +954,7 @@ public static BtcFormat getCoinInstance(Locale locale) {

/**
* Return a newly-constructed instance for the given locale that will format
* values in terms of bitcoins, with the given minimum number of fractional
* values in terms of ferritecoins, with the given minimum number of fractional
* decimal places. Optionally, repeating integer arguments can be passed, each
* indicating the size of an additional group of fractional decimal places to be
* used as necessary to avoid rounding, to a limiting precision of satoshis.
Expand Down Expand Up @@ -1112,7 +1112,7 @@ public static BtcFormat getInstance(int scale, Locale locale, int minDecimals, L
/***********************/

/**
* Formats a bitcoin monetary value and returns an {@link java.text.AttributedCharacterIterator}.
* Formats a ferritecoin monetary value and returns an {@link java.text.AttributedCharacterIterator}.
* By iterating, you can examine what fields apply to each character. This can be useful
* since a character may be part of more than one field, for example a grouping separator
* that is also part of the integer field.
Expand All @@ -1131,13 +1131,13 @@ public AttributedCharacterIterator formatToCharacterIterator(Object obj) { synch
}}

/**
* Formats a bitcoin value as a number and possibly a units indicator and appends the
* Formats a ferritecoin value as a number and possibly a units indicator and appends the
* resulting text to the given string buffer. The type of monetary value argument can be
* any one of any of the following classes: <code>{@link Coin}</code>,
* <code>Integer</code>, <code>Long</code>, <code>BigInteger</code>,
* <code>BigDecimal</code>. Numeric types that can represent only an integer are interpreted
* as that number of satoshis. The value of a <code>BigDecimal</code> is interpreted as that
* number of bitcoins, rounded to the nearest satoshi as necessary.
* number of ferritecoins, rounded to the nearest satoshi as necessary.
*
* @return the <code>StringBuffer</code> passed in as <code>toAppendTo</code>
*/
Expand All @@ -1147,12 +1147,12 @@ public StringBuffer format(Object qty, StringBuffer toAppendTo, FieldPosition po
}

/**
* Formats a bitcoin value as a number and possibly a units indicator to a
* Formats a ferritecoin value as a number and possibly a units indicator to a
* <code>String</code>.The type of monetary value argument can be any one of any of the
* following classes: <code>{@link Coin}</code>, <code>Integer</code>, <code>Long</code>,
* <code>BigInteger</code>, <code>BigDecimal</code>. Numeric types that can represent only
* an integer are interpreted as that number of satoshis. The value of a
* <code>BigDecimal</code> is interpreted as that number of bitcoins, rounded to the
* <code>BigDecimal</code> is interpreted as that number of ferritecoins, rounded to the
* nearest satoshi as necessary.
*
* @param minDecimals The minimum number of decimal places in the fractional part of the formatted number
Expand All @@ -1164,13 +1164,13 @@ public String format(Object qty, int minDecimals, int... fractionGroups) {
}

/**
* Formats a bitcoin value as a number and possibly a units indicator and appends the
* Formats a ferritecoin value as a number and possibly a units indicator and appends the
* resulting text to the given string buffer. The type of monetary value argument can be
* any one of any of the following classes: <code>{@link Coin}</code>,
* <code>Integer</code>, <code>Long</code>, <code>BigInteger</code>,
* <code>BigDecimal</code>. Numeric types that can represent only an integer are interpreted
* as that number of satoshis. The value of a <code>BigDecimal</code> is interpreted as that
* number of bitcoins, rounded to the nearest satoshi as necessary.
* number of ferritecoins, rounded to the nearest satoshi as necessary.
*
* @param minDecimals The minimum number of decimal places in the fractional part of the formatted number
* @param fractionGroups The sizes of optional additional fractional decimal-place groups
Expand Down Expand Up @@ -1199,7 +1199,7 @@ private StringBuffer format(Object qty, StringBuffer toAppendTo, FieldPosition p
/**
* Return the denomination for formatting the given value. The returned <code>int</code>
* is the size of the decimal-place shift between the given Bitcoin-value denominated in
* bitcoins and that same value as formatted. A fixed-denomination formatter will ignore
* ferritecoins and that same value as formatted. A fixed-denomination formatter will ignore
* the arguments.
*
* @param satoshis The number of satoshis having the value for which the shift is calculated
Expand All @@ -1215,7 +1215,7 @@ private StringBuffer format(Object qty, StringBuffer toAppendTo, FieldPosition p
protected abstract int scale();

/**
* Takes a bitcoin monetary value that the client wants to format and returns the number of
* Takes a ferritecoin monetary value that the client wants to format and returns the number of
* denominational units having the equal value, rounded to the appropriate number of
* decimal places. Calls the scale() method of the subclass, which may have the
* side-effect of changing the currency symbol and code of the underlying `NumberFormat`
Expand Down Expand Up @@ -1274,12 +1274,12 @@ private static int calculateFractionPlaces(
}

/**
* Takes an object representing a bitcoin quantity of any type the
* Takes an object representing a ferritecoin quantity of any type the
* client is permitted to pass us, and return a BigInteger representing the
* number of satoshis having the equivalent value. */
private static BigInteger inSatoshis(Object qty) {
BigInteger satoshis;
// the value might be bitcoins or satoshis
// the value might be ferritecoins or satoshis
if (qty instanceof Long || qty instanceof Integer)
satoshis = BigInteger.valueOf(((Number)qty).longValue());
else if (qty instanceof BigInteger)
Expand Down Expand Up @@ -1395,9 +1395,9 @@ protected static void prefixUnitsIndicator(DecimalFormat numberFormat, int scale
* will be recognized, and the parsed number will be interpreted as a quantity of units
* having that recognized denomination.
* <p>If the pattern includes a currency sign but no currency sign is detected in the parsed
* String, then the number is interpreted as a quatity of bitcoins.
* String, then the number is interpreted as a quatity of ferritecoins.
* <p>If the pattern contains neither a currency symbol nor sign, then instances of {@link
* BtcAutoFormat} will interpret the parsed number as a quantity of bitcoins, and instances
* BtcAutoFormat} will interpret the parsed number as a quantity of ferritecoins, and instances
* of {@link BtcAutoFormat} will interpret the number as a quantity of that instance's
* configured denomination, which can be ascertained by invoking the {@link
* BtcFixedFormat#symbol()} or {@link BtcFixedFormat#code()} method.
Expand Down Expand Up @@ -1449,9 +1449,9 @@ public Coin parse(String source, ParsePosition pos) {
* will be recognized, and the parsed number will be interpreted as a quantity of units
* having that recognized denomination.
* <p>If the pattern includes a currency sign but no currency sign is detected in the parsed
* String, then the number is interpreted as a quatity of bitcoins.
* String, then the number is interpreted as a quatity of ferritecoins.
* <p>If the pattern contains neither a currency symbol nor sign, then instances of {@link
* BtcAutoFormat} will interpret the parsed number as a quantity of bitcoins, and instances
* BtcAutoFormat} will interpret the parsed number as a quantity of ferritecoins, and instances
* of {@link BtcAutoFormat} will interpret the number as a quantity of that instance's
* configured denomination, which can be ascertained by invoking the {@link
* BtcFixedFormat#symbol()} or {@link BtcFixedFormat#code()} method.
Expand Down Expand Up @@ -1526,13 +1526,13 @@ protected static String negify(String pattern) {
*/
public static Locale[] getAvailableLocales() { return NumberFormat.getAvailableLocales(); }

/** Return the unprefixed currency symbol for bitcoins configured for this object. The
/** Return the unprefixed currency symbol for ferritecoins configured for this object. The
* return value of this method is constant throughough the life of an instance. */
public String coinSymbol() { synchronized(numberFormat) {
return numberFormat.getDecimalFormatSymbols().getCurrencySymbol();
}}

/** Return the unprefixed international currency code for bitcoins configured for this
/** Return the unprefixed international currency code for ferritecoins configured for this
* object. The return value of this method is constant throughough the life of an instance. */
public String coinCode() { synchronized(numberFormat) {
return numberFormat.getDecimalFormatSymbols().getInternationalCurrencySymbol();
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/utils/Fiat.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class Fiat implements Monetary, Comparable<Fiat>, Serializable {
* The absolute value of exponent of the value of a "smallest unit" in scientific notation. We picked 4 rather than
* 2, because in financial applications it's common to use sub-cent precision.
*/
public static final int SMALLEST_UNIT_EXPONENT = 4;
public static final int SMALLEST_UNIT_EXPONENT = 6;

/**
* The number of smallest units of this monetary value.
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public final class MonetaryFormat {
/** Standard format for fiat amounts. */
public static final MonetaryFormat FIAT = new MonetaryFormat().shift(0).minDecimals(2).repeatOptionalDecimals(2, 1);
/** Currency code for base 1 Bitcoin. */
public static final String CODE_BTC = "BTC";
public static final String CODE_BTC = "FEC";
/** Currency code for base 1/1000 Bitcoin. */
public static final String CODE_MBTC = "mBTC";
public static final String CODE_MBTC = "mFEC";
/** Currency code for base 1/1000000 Bitcoin. */
public static final String CODE_UBTC = "µBTC";

Expand Down
Loading

0 comments on commit d7e88cb

Please sign in to comment.