From 20aaf5867e5fdd996ed23c6327612866bcb34d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kudela?= <kudmich@syncad.com> Date: Thu, 27 Feb 2025 10:53:46 +0100 Subject: [PATCH] Add test for estimate_hive_collateral method --- .../base_api/test_estimate_hive_collateral.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 python/tests/base_api/test_estimate_hive_collateral.py diff --git a/python/tests/base_api/test_estimate_hive_collateral.py b/python/tests/base_api/test_estimate_hive_collateral.py new file mode 100644 index 000000000..5c5d92acb --- /dev/null +++ b/python/tests/base_api/test_estimate_hive_collateral.py @@ -0,0 +1,21 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import pytest + +if TYPE_CHECKING: + from wax.interfaces import IWaxBaseInterface + + +@pytest.mark.descrbe("Should be able to estimate hive collateral") +def test_estimate_hive_collateral(wax: IWaxBaseInterface) -> None: + estimated_hive_collateral = wax.estimate_hive_collateral( + current_median_history_base=wax.hbd.satoshis(201), + current_median_history_quote=wax.hive.satoshis(1000), + current_min_history_base=wax.hbd.satoshis(197), + current_min_history_quote=wax.hive.satoshis(1000), + hbd_amount_to_get=wax.hbd.satoshis(100000), + ) + + assert estimated_hive_collateral == wax.hive.satoshis(1065988) -- GitLab