예제 #1
0
def test_get_eth2_details_validator_not_yet_active(beaconchain, inquirer):  # pylint: disable=unused-argument  # noqa: E501
    """Test that if a validator is detected but is not yet active the balance is shown properly

    Test for: https://github.com/rotki/rotki/issues/1888
    """
    with _create_beacon_mock(beaconchain):
        details = get_eth2_details(beaconchain=beaconchain, addresses=[ADDR1])

    expected_details = [
        ValidatorDetails(
            validator_index=9,
            public_key=
            '0xb016e31f633a21fbe42a015152399361184f1e2c0803d89823c224994af74a561c4ad8cfc94b18781d589d03e952cd5b',  # noqa: E501
            eth1_depositor=ADDR1,
            performance=ValidatorPerformance(
                balance=32143716247,
                performance_1d=14437802,
                performance_1w=105960750,
                performance_1m=143716247,
                performance_1y=143716247,
            ),
        ),
        ValidatorDetails(
            validator_index=1507,
            public_key=
            '0x8b242e5cdb0a7740a605f3c39262253eb2b5e7ee514a544e823f996e8de9961db7d5264d08c5ce13a65efa82b868accc',  # noqa: E501
            eth1_depositor=ADDR1,
            performance=DEPOSITING_VALIDATOR_PERFORMANCE,
        ),
    ]
    assert details == expected_details
예제 #2
0
파일: test_eth2.py 프로젝트: sveitser/rotki
def test_get_eth2_details_validator_not_yet_active(beaconchain, inquirer):  # pylint: disable=unused-argument  # noqa: E501
    """Test that if a validator is detected but is not yet active the balance is shown properly

    Test for: https://github.com/rotki/rotki/issues/1888
    """
    with _create_beacon_mock(beaconchain):
        details = get_eth2_details(beaconchain=beaconchain, addresses=[ADDR1])

    expected_details = [
        ValidatorDetails(
            validator_index=9,
            eth1_depositor=ADDR1,
            performance=ValidatorPerformance(
                balance=32143716247,
                performance_1d=14437802,
                performance_1w=105960750,
                performance_1m=143716247,
                performance_1y=143716247,
            ),
        ),
        ValidatorDetails(
            validator_index=1507,
            eth1_depositor=ADDR1,
            performance=DEPOSITING_VALIDATOR_PERFORMANCE,
        ),
    ]
    assert details == expected_details
예제 #3
0
파일: manager.py 프로젝트: philhug/rotki
 def get_eth2_staking_details(self) -> List[ValidatorDetails]:
     return get_eth2_details(
         beaconchain=self.beaconchain,
         addresses=self.accounts.eth,
     )