[#1273] 10_000-ZAT Miners fee

- Removed all uses of the incorrect 1000-ZAT fee as defined with  deprecated zip-313
- Default is now 10k zatoshi, the minimum defined by zip-317
- Changelog updated
- Closes  #1273
This commit is contained in:
Honza Rychnovský 2023-10-02 12:49:36 +02:00 committed by GitHub
parent ebde156c6c
commit ddffd170d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,9 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `PersistableWallet` API provides a new `endpoint` parameter of type `LightWalletEndpoint`, which could be used for
the Lightwalletd server customization. The new parameter is part of PersistableWallet persistence. The SDK handles
the persistence migration internally.
- The **1_000** Zatoshi fee proposed in ZIP-313 is deprecated now, so the minimum is **10_000** Zatoshi, defined in
ZIP-317—the ZcashSdk.MINERS_FEE now returns the correct value as described above. Note that the actual fee is
handled in a rust layer.
## [2.0.0] - 2023-09-25

View File

@ -154,6 +154,8 @@ private fun BalanceMainContent(
)
)
// TODO [#776]: Support variable fees
// TODO [#776]: https://github.com/zcash/zcash-android-wallet-sdk/issues/776
// This check will not be correct with variable fees
if (walletSnapshot.transparentBalance.available > ZcashSdk.MINERS_FEE) {
// Note this implementation does not guard against multiple clicks

View File

@ -16,9 +16,11 @@ data class WalletSnapshot(
val progress: PercentDecimal,
val synchronizerError: SynchronizerError?
) {
// TODO [#776]: Support variable fees
// TODO [#776]: https://github.com/zcash/zcash-android-wallet-sdk/issues/776
// Note: the wallet is effectively empty if it cannot cover the miner's fee
val hasFunds = saplingBalance.available.value >
(ZcashSdk.MINERS_FEE.value.toDouble() / Zatoshi.ZATOSHI_PER_ZEC) // 0.00001
(ZcashSdk.MINERS_FEE.value.toDouble() / Zatoshi.ZATOSHI_PER_ZEC) // 0.0001
val hasSaplingBalance = saplingBalance.total.value > 0
val isSendEnabled: Boolean get() = status == Synchronizer.Status.SYNCED && hasFunds

View File

@ -14,7 +14,7 @@ object ZcashSdk {
/**
* Miner's fee in zatoshi.
*/
val MINERS_FEE = Zatoshi(1_000L)
val MINERS_FEE = Zatoshi(10_000L)
/**
* The maximum length of a memo.