Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
wax
Commits
cca8455a
Commit
cca8455a
authored
1 month ago
by
Michał Kudela
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for calculate_hp_apr method
parent
a894d09b
No related branches found
No related tags found
2 merge requests
!262
Duplicate typeScript tests to python
,
!230
Implementation of the python wax interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/tests/base_api/test_calculate_hp_apr.py
+23
-0
23 additions, 0 deletions
python/tests/base_api/test_calculate_hp_apr.py
with
23 additions
and
0 deletions
python/tests/base_api/test_calculate_hp_apr.py
0 → 100644
+
23
−
0
View file @
cca8455a
from
__future__
import
annotations
from
decimal
import
Decimal
from
typing
import
TYPE_CHECKING
import
pytest
if
TYPE_CHECKING
:
from
wax.interfaces
import
IWaxBaseInterface
@pytest.mark.parametrize
(
"
unit_amount
"
,
[
"
coins
"
,
"
satoshis
"
])
@pytest.mark.descrbe
(
"
Should be able to calculate HP APR
"
)
def
test_calculate_hp_apr
(
wax
:
IWaxBaseInterface
,
unit_amount
:
str
)
->
None
:
hive_unit
=
getattr
(
wax
.
hive
,
unit_amount
)
hp_apr
=
wax
.
calculate_hp_apr
(
head_block_num
=
1_000_000
,
vesting_reward_percent
=
1_500
,
virtual_supply
=
hive_unit
(
10
),
total_vesting_fund_hive
=
hive_unit
(
10
),
)
assert
hp_apr
==
Decimal
(
"
1.46
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment