Page MenuHomePhabricator

D9865.diff
No OneTemporary

D9865.diff

diff --git a/web/cashtab/src/components/Common/Ticker.js b/web/cashtab/src/components/Common/Ticker.js
--- a/web/cashtab/src/components/Common/Ticker.js
+++ b/web/cashtab/src/components/Common/Ticker.js
@@ -11,7 +11,8 @@
prefixes: ['bitcoincash', 'ecash'],
coingeckoId: 'bitcoin-cash-abc-2',
defaultFee: 2.01,
- dustSats: 546,
+ dustSats: 550,
+ etokenSats: 546,
cashDecimals: 2,
blockExplorerUrl: 'https://explorer.bitcoinabc.org',
tokenExplorerUrl: 'https://explorer.be.cash',
diff --git a/web/cashtab/src/hooks/__mocks__/sendBCH.js b/web/cashtab/src/hooks/__mocks__/sendBCH.js
--- a/web/cashtab/src/hooks/__mocks__/sendBCH.js
+++ b/web/cashtab/src/hooks/__mocks__/sendBCH.js
@@ -34,6 +34,6 @@
expectedTxId:
'7a39961bbd7e27d804fb3169ef38a83234710fbc53897a4eb0c98454854a26d1',
expectedHex: [
- '02000000016fbde3a1a13bb90e1d939a214d6eb845396e6a07e2c4406c5ba8b554bfb4836e010000006b483045022100d52237ac2c000c0be195bb27d5488b378559cf4a7958c9a1b1ce7a6850773a2b02202e3c148450c6efdb11f199a9398332b313b54686ff98cf74b254f9ae144b0c7d4121032d9ea429b4782e9a2c18a383362c23a44efa2f6d6641d63f53788b4bf45c1decffffffff0222020000000000001976a914d530980e14ee1f2037eaf00164d9c7ccfbddcd3288ac62ff0100000000001976a914c5c649ec64e02a16a5bd7a6c8f1fa5aaa7e488eb88ac00000000',
+ '02000000016fbde3a1a13bb90e1d939a214d6eb845396e6a07e2c4406c5ba8b554bfb4836e010000006a47304402207f641d1822e2bad12178238155516dc3a00d7aea25ef54fc602cc3390093c6ef022066b0bbbfb931c1c7d3d56b56b51e5ee4e9782ac51a4955bf06e0177533ad0c5c4121032d9ea429b4782e9a2c18a383362c23a44efa2f6d6641d63f53788b4bf45c1decffffffff0226020000000000001976a914d530980e14ee1f2037eaf00164d9c7ccfbddcd3288ac5eff0100000000001976a914c5c649ec64e02a16a5bd7a6c8f1fa5aaa7e488eb88ac00000000',
],
};
diff --git a/web/cashtab/src/hooks/__tests__/migrations.test.js b/web/cashtab/src/hooks/__tests__/migrations.test.js
--- a/web/cashtab/src/hooks/__tests__/migrations.test.js
+++ b/web/cashtab/src/hooks/__tests__/migrations.test.js
@@ -14,7 +14,7 @@
fromSmallestDenomination(currency.dustSats, 8).toString(),
).toFixed(8),
),
- ).toBe(0.00000546);
+ ).toBe(0.0000055);
});
it('Replicate 8-decimal return value from instance of toSatoshi in TransactionBuilder with toSmallestDenomination', () => {
const BCH = new BCHJS();
@@ -132,7 +132,7 @@
it(`Converts dust limit in satoshis to dust limit in current app setting`, () => {
expect(fromSmallestDenomination(currency.dustSats, 8).toString()).toBe(
- '0.00000546',
+ '0.0000055',
);
});
});
diff --git a/web/cashtab/src/hooks/useBCH.js b/web/cashtab/src/hooks/useBCH.js
--- a/web/cashtab/src/hooks/useBCH.js
+++ b/web/cashtab/src/hooks/useBCH.js
@@ -384,7 +384,9 @@
// Do not classify any utxos that include token information as nonSlpUtxos
const nonSlpUtxos = hydratedUtxos.filter(
utxo =>
- utxo.isValid === false && utxo.value !== 546 && !utxo.tokenName,
+ utxo.isValid === false &&
+ utxo.value !== currency.etokenSats &&
+ !utxo.tokenName,
);
// To be included in slpUtxos, the utxo must
// have utxo.isValid = true
@@ -534,7 +536,7 @@
if (
originalAmount
- .minus(new BigNumber(currency.dustSats))
+ .minus(new BigNumber(currency.etokenSats))
.minus(new BigNumber(txFee))
.gte(0)
) {
@@ -544,7 +546,7 @@
// amount to send back to the remainder address.
const remainder = originalAmount
- .minus(new BigNumber(currency.dustSats))
+ .minus(new BigNumber(currency.etokenSats))
.minus(new BigNumber(txFee));
if (remainder.lt(0)) {
@@ -561,10 +563,10 @@
transactionBuilder.addOutput(script, 0);
// add output w/ address and amount to send
- transactionBuilder.addOutput(CREATION_ADDR, currency.dustSats);
+ transactionBuilder.addOutput(CREATION_ADDR, currency.etokenSats);
// Send change to own address
- if (remainder.gte(new BigNumber(currency.dustSats))) {
+ if (remainder.gte(new BigNumber(currency.etokenSats))) {
transactionBuilder.addOutput(
CREATION_ADDR,
parseInt(remainder),
@@ -720,7 +722,7 @@
// Send dust transaction representing tokens being sent.
transactionBuilder.addOutput(
BCH.SLP.Address.toLegacyAddress(tokenReceiverAddress),
- 546,
+ currency.etokenSats,
);
// Return any token change back to the sender.
@@ -730,7 +732,7 @@
BCH.SLP.Address.toLegacyAddress(
tokenUtxosBeingSpent[0].address,
),
- 546,
+ currency.etokenSats,
);
}
@@ -744,7 +746,7 @@
);
// amount to send back to the sending address. It's the original amount - 1 sat/byte for tx size
- const remainder = originalAmount - txFee - 546 * 2;
+ const remainder = originalAmount - txFee - currency.etokenSats * 2;
if (remainder < 1) {
throw new Error('Selected UTXO does not have enough satoshis');
}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 26, 11:04 (10 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5573353
Default Alt Text
D9865.diff (5 KB)

Event Timeline