mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
* Feature: time measuring for RPC-tracing * Performance warnings and hints * adjust treshold to 7 seconds * refactor api wallets endpoints to own file * more consistent error-handling * fee endpoint * refactoring tx-table to hide columns and add customaction * replace coin_selection with webcomponent * fix fee-test * fix fee-test * fix fee-estimation * fee selection web-component * bugfixes * fix test * using events to communicate changes * tidy up * fix selectedCoins * fix tests * no fee_rate calc in send_new endpoint and GET for fetchAssetBalances * refactor estimate_fee out from send_new * fix assetLabel * Do not use assetBalances-endpoint but pass as property * Typos corrected, RBF functionality restored, bugs in fee selection fixed and fee default settings improved. Co-authored-by: moneymanolis <moneymanolis@protonmail.com> Co-authored-by: Manolis <70536101+moneymanolis@users.noreply.github.com>
23 lines
683 B
Python
23 lines
683 B
Python
import json
|
|
from cryptoadvance.specter.util.fee_estimation import (
|
|
FeeEstimationResult,
|
|
FeeEstimationResultEncoder,
|
|
)
|
|
|
|
|
|
def test_FeeEstimationResultEncoder():
|
|
|
|
fee_estimation = FeeEstimationResult(
|
|
{
|
|
"fastestFee": 1,
|
|
"halfHourFee": 1,
|
|
"hourFee": 1,
|
|
"minimumFee": 1,
|
|
}
|
|
)
|
|
fee_estimation.add_error_message("some error message ")
|
|
fee_estimation.add_error_message("yet another one")
|
|
my_json = json.dumps(fee_estimation, cls=FeeEstimationResultEncoder)
|
|
my_dict = json.loads(my_json)
|
|
assert my_dict["result"]["fastestFee"] == 1
|
|
assert my_dict["error_messages"][1] == "yet another one"
|