Merge pull request #779 from cypherstack/fees

Fix fees when returned in scientific notation
This commit is contained in:
Diego Salazar 2024-02-26 22:03:49 -07:00 committed by GitHub
commit 97f2262cf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 15 deletions

View file

@ -1020,18 +1020,6 @@ class ElectrumXClient {
], ],
); );
try { try {
// If the response is -1 or null, return a temporary hardcoded value for
// Dogecoin. This is a temporary fix until the fee estimation is fixed.
if (coin == Coin.dogecoin &&
(response == null ||
response == -1 ||
Decimal.parse(response.toString()) == Decimal.parse("-1"))) {
// Return 0.05 for slow, 0.2 for average, and 1 for fast txs.
// These numbers produce tx fees in line with txs in the wild on
// https://dogechain.info/
return Decimal.parse((1 / blocks).toString());
// TODO [prio=med]: Fix fee estimation.
}
return Decimal.parse(response.toString()); return Decimal.parse(response.toString());
} catch (e, s) { } catch (e, s) {
final String msg = "Error parsing fee rate. Response: $response" final String msg = "Error parsing fee rate. Response: $response"

View file

@ -528,8 +528,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "0a34f7f48d921fb33f551cb11dfc9b2930522240" ref: "2897c6448e131241d4d91fe23fdab83305134225"
resolved-ref: "0a34f7f48d921fb33f551cb11dfc9b2930522240" resolved-ref: "2897c6448e131241d4d91fe23fdab83305134225"
url: "https://github.com/cypherstack/electrum_adapter.git" url: "https://github.com/cypherstack/electrum_adapter.git"
source: git source: git
version: "3.0.0" version: "3.0.0"

View file

@ -176,7 +176,7 @@ dependencies:
electrum_adapter: electrum_adapter:
git: git:
url: https://github.com/cypherstack/electrum_adapter.git url: https://github.com/cypherstack/electrum_adapter.git
ref: 0a34f7f48d921fb33f551cb11dfc9b2930522240 ref: 2897c6448e131241d4d91fe23fdab83305134225
stream_channel: ^2.1.0 stream_channel: ^2.1.0
dev_dependencies: dev_dependencies: