-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from lidofinance/develop
Depositor bot release (#274)
- Loading branch information
Showing
10 changed files
with
160 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import abc | ||
|
||
|
||
class DepositStrategy(abc.ABC): | ||
@abc.abstractmethod | ||
def can_deposit_keys_based_on_ether(self, module_id: int) -> bool: | ||
pass | ||
|
||
@abc.abstractmethod | ||
def is_gas_price_ok(self, module_id: int) -> bool: | ||
pass |
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
13 changes: 13 additions & 0 deletions
13
tests/blockchain/deposit_strategy/test_base_deposit_strategy.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from unittest.mock import Mock | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.unit | ||
def test_csm_deposit_strategy(csm_strategy): | ||
csm_strategy.deposited_keys_amount = Mock(return_value=1) | ||
assert not csm_strategy.can_deposit_keys_based_on_ether(3) | ||
|
||
csm_strategy.deposited_keys_amount = Mock(return_value=2) | ||
csm_strategy._gas_price_calculator.get_pending_base_fee = Mock(return_value=10) | ||
assert csm_strategy.can_deposit_keys_based_on_ether(3) |
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
Oops, something went wrong.