-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert eth to wei, exclude last block with reward, general refactor
- Loading branch information
1 parent
af5f4e9
commit 5afd959
Showing
12 changed files
with
111 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
backend/tests/infrastracture/external_api/bitquery/test_acc_blocks_reward.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import pytest | ||
from app.infrastructure.external_api.bitquery.blocks_reward import ( | ||
accumulate_blocks_reward_wei, | ||
from app.modules.staking.proceeds.core import ( | ||
sum_blocks_rewards, | ||
) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"blocks, result", | ||
[([{"reward": 0.024473700594149782}, {"reward": 0.05342909432569912}], 77902794)], | ||
[ | ||
( | ||
[{"reward": 0.024473700594149782}, {"reward": 0.05342909432569912}], | ||
77902794919848899, | ||
) | ||
], | ||
) | ||
def test_accumulate_blocks_reward_wei(blocks, result): | ||
actual_result = accumulate_blocks_reward_wei(blocks) | ||
def test_sum_blocks_rewards(blocks, result): | ||
actual_result = sum_blocks_rewards(blocks) | ||
assert actual_result == result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters