-
Notifications
You must be signed in to change notification settings - Fork 4
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 #1127 from skalenetwork/develop
Fix various checks issues (beta)
- Loading branch information
Showing
12 changed files
with
75 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,6 @@ tests/skale-data/contracts_info/schain_ima_abi.json | |
temp_* | ||
|
||
.DS_Store | ||
.coverage* | ||
.coverage* | ||
|
||
.env |
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 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 |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import freezegun | ||
|
||
from core.schains.info import get_schain_info_by_name | ||
from tests.utils import upsert_schain_record_with_config | ||
from tests.utils import CURRENT_DATETIME, upsert_schain_record_with_config | ||
|
||
|
||
@freezegun.freeze_time(CURRENT_DATETIME) | ||
def test_get_schain_info_by_name(skale, schain_on_contracts, schain_db): | ||
name = schain_on_contracts | ||
upsert_schain_record_with_config(name) | ||
schain_record = upsert_schain_record_with_config(name) | ||
info = get_schain_info_by_name(skale, name) | ||
expected_ts = int(schain_record.repair_date.timestamp()) | ||
assert info.name == name | ||
assert info.schain_id == skale.schains.name_to_id(name) | ||
assert info.part_of_node == 1 | ||
assert info.dkg_status == 1 | ||
assert not info.is_deleted | ||
assert info.first_run | ||
assert not info.repair_mode | ||
assert info.repair_ts == expected_ts | ||
|
||
assert info.to_dict() == { | ||
'name': name, | ||
'id': skale.schains.name_to_id(name), | ||
'mainnet_owner': info.mainnet_owner, | ||
'part_of_node': 1, | ||
'dkg_status': 1, | ||
'is_deleted': False, | ||
'first_run': True, | ||
'repair_mode': False | ||
'name': name, | ||
'id': skale.schains.name_to_id(name), | ||
'mainnet_owner': info.mainnet_owner, | ||
'part_of_node': 1, | ||
'dkg_status': 1, | ||
'is_deleted': False, | ||
'first_run': True, | ||
'repair_ts': expected_ts, | ||
} | ||
|
||
|
||
def test_get_schain_info_by_name_not_exist_contracts( | ||
skale, schain_db | ||
): | ||
def test_get_schain_info_by_name_not_exist_contracts(skale, schain_db): | ||
name = 'undefined_schain' | ||
info = get_schain_info_by_name(skale, name) | ||
assert info is None | ||
|
||
|
||
def test_get_schain_info_by_name_not_exist_db( | ||
skale, schain_on_contracts, db | ||
): | ||
def test_get_schain_info_by_name_not_exist_db(skale, schain_on_contracts, db): | ||
name = schain_on_contracts | ||
info = get_schain_info_by_name(skale, name) | ||
assert info is None |
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
Oops, something went wrong.