Jul 03, 8-9 AM (26)
Jul 03, 9-10 AM (8)
Jul 03, 10-11 AM (25)
Jul 03, 11-12 PM (12)
Jul 03, 12-1 PM (15)
Jul 03, 1-2 PM (24)
Jul 03, 2-3 PM (37)
Jul 03, 3-4 PM (12)
Jul 03, 4-5 PM (15)
Jul 03, 5-6 PM (7)
Jul 03, 6-7 PM (9)
Jul 03, 7-8 PM (13)
Jul 03, 8-9 PM (16)
Jul 03, 9-10 PM (16)
Jul 03, 10-11 PM (14)
Jul 03, 11-12 AM (12)
Jul 04, 12-1 AM (4)
Jul 04, 1-2 AM (3)
Jul 04, 2-3 AM (0)
Jul 04, 3-4 AM (0)
Jul 04, 4-5 AM (0)
Jul 04, 5-6 AM (0)
Jul 04, 6-7 AM (0)
Jul 04, 7-8 AM (1)
Jul 04, 8-9 AM (0)
Jul 04, 9-10 AM (0)
Jul 04, 10-11 AM (3)
Jul 04, 11-12 PM (2)
Jul 04, 12-1 PM (0)
Jul 04, 1-2 PM (2)
Jul 04, 2-3 PM (5)
Jul 04, 3-4 PM (1)
Jul 04, 4-5 PM (2)
Jul 04, 5-6 PM (3)
Jul 04, 6-7 PM (1)
Jul 04, 7-8 PM (0)
Jul 04, 8-9 PM (0)
Jul 04, 9-10 PM (0)
Jul 04, 10-11 PM (0)
Jul 04, 11-12 AM (2)
Jul 05, 12-1 AM (4)
Jul 05, 1-2 AM (0)
Jul 05, 2-3 AM (2)
Jul 05, 3-4 AM (1)
Jul 05, 4-5 AM (0)
Jul 05, 5-6 AM (6)
Jul 05, 6-7 AM (0)
Jul 05, 7-8 AM (1)
Jul 05, 8-9 AM (6)
Jul 05, 9-10 AM (28)
Jul 05, 10-11 AM (4)
Jul 05, 11-12 PM (5)
Jul 05, 12-1 PM (0)
Jul 05, 1-2 PM (1)
Jul 05, 2-3 PM (8)
Jul 05, 3-4 PM (4)
Jul 05, 4-5 PM (2)
Jul 05, 5-6 PM (1)
Jul 05, 6-7 PM (2)
Jul 05, 7-8 PM (0)
Jul 05, 8-9 PM (6)
Jul 05, 9-10 PM (5)
Jul 05, 10-11 PM (2)
Jul 05, 11-12 AM (11)
Jul 06, 12-1 AM (12)
Jul 06, 1-2 AM (18)
Jul 06, 2-3 AM (21)
Jul 06, 3-4 AM (9)
Jul 06, 4-5 AM (34)
Jul 06, 5-6 AM (25)
Jul 06, 6-7 AM (22)
Jul 06, 7-8 AM (30)
Jul 06, 8-9 AM (28)
Jul 06, 9-10 AM (16)
Jul 06, 10-11 AM (23)
Jul 06, 11-12 PM (41)
Jul 06, 12-1 PM (26)
Jul 06, 1-2 PM (18)
Jul 06, 2-3 PM (42)
Jul 06, 3-4 PM (24)
Jul 06, 4-5 PM (17)
Jul 06, 5-6 PM (13)
Jul 06, 6-7 PM (21)
Jul 06, 7-8 PM (11)
Jul 06, 8-9 PM (27)
Jul 06, 9-10 PM (11)
Jul 06, 10-11 PM (13)
Jul 06, 11-12 AM (29)
Jul 07, 12-1 AM (15)
Jul 07, 1-2 AM (1)
Jul 07, 2-3 AM (27)
Jul 07, 3-4 AM (6)
Jul 07, 4-5 AM (43)
Jul 07, 5-6 AM (12)
Jul 07, 6-7 AM (13)
Jul 07, 7-8 AM (34)
Jul 07, 8-9 AM (56)
Jul 07, 9-10 AM (20)
Jul 07, 10-11 AM (21)
Jul 07, 11-12 PM (40)
Jul 07, 12-1 PM (21)
Jul 07, 1-2 PM (39)
Jul 07, 2-3 PM (44)
Jul 07, 3-4 PM (27)
Jul 07, 4-5 PM (16)
Jul 07, 5-6 PM (16)
Jul 07, 6-7 PM (31)
Jul 07, 7-8 PM (9)
Jul 07, 8-9 PM (5)
Jul 07, 9-10 PM (7)
Jul 07, 10-11 PM (10)
Jul 07, 11-12 AM (7)
Jul 08, 12-1 AM (19)
Jul 08, 1-2 AM (10)
Jul 08, 2-3 AM (47)
Jul 08, 3-4 AM (10)
Jul 08, 4-5 AM (13)
Jul 08, 5-6 AM (17)
Jul 08, 6-7 AM (21)
Jul 08, 7-8 AM (25)
Jul 08, 8-9 AM (36)
Jul 08, 9-10 AM (16)
Jul 08, 10-11 AM (14)
Jul 08, 11-12 PM (25)
Jul 08, 12-1 PM (23)
Jul 08, 1-2 PM (46)
Jul 08, 2-3 PM (32)
Jul 08, 3-4 PM (31)
Jul 08, 4-5 PM (15)
Jul 08, 5-6 PM (53)
Jul 08, 6-7 PM (21)
Jul 08, 7-8 PM (19)
Jul 08, 8-9 PM (7)
Jul 08, 9-10 PM (9)
Jul 08, 10-11 PM (5)
Jul 08, 11-12 AM (10)
Jul 09, 12-1 AM (57)
Jul 09, 1-2 AM (5)
Jul 09, 2-3 AM (22)
Jul 09, 3-4 AM (2)
Jul 09, 4-5 AM (11)
Jul 09, 5-6 AM (15)
Jul 09, 6-7 AM (11)
Jul 09, 7-8 AM (25)
Jul 09, 8-9 AM (33)
Jul 09, 9-10 AM (32)
Jul 09, 10-11 AM (12)
Jul 09, 11-12 PM (18)
Jul 09, 12-1 PM (37)
Jul 09, 1-2 PM (38)
Jul 09, 2-3 PM (40)
Jul 09, 3-4 PM (48)
Jul 09, 4-5 PM (27)
Jul 09, 5-6 PM (13)
Jul 09, 6-7 PM (4)
Jul 09, 7-8 PM (4)
Jul 09, 8-9 PM (7)
Jul 09, 9-10 PM (4)
Jul 09, 10-11 PM (5)
Jul 09, 11-12 AM (2)
Jul 10, 12-1 AM (12)
Jul 10, 1-2 AM (3)
Jul 10, 2-3 AM (15)
Jul 10, 3-4 AM (22)
Jul 10, 4-5 AM (79)
Jul 10, 5-6 AM (13)
Jul 10, 6-7 AM (26)
Jul 10, 7-8 AM (21)
Jul 10, 8-9 AM (0)
2,627 commits this week Jul 03, 2020 - Jul 10, 2020
Merge #1847
1847: Track Stakepool Retirements in the DB r=jonathanknowles a=jonathanknowles

# Related Issues

#1815 
#1816 
#1817 
#1819 
#1880 

# Overview

This PR:

- [x] Extends the pool DB schema to make it possible to store:
    - [x] retirement certificates.
    - [x] the _order_ of publication of certificates _within the same block_, for both registration and retirement certificates. This is necessary, as the intra-block order is _significant_.<br><br>

- [x] Adds the `PoolLifeCycleStatus` type, which indicates the current lifecycle stage of a pool.

    There are currently _three_ possibilities:
    1. `NotRegistered`
        (indicates that a pool has never been registered)
    2. `Registered`
        (indicates that a pool has been registered but _not_ retired)
        (provides a registration certificate)
    3. `RegisteredAndRetired`
        (indicates that a pool has been registered _and_ retired)
        (provides both a registration and a retirement certificate)<br><br>

- [x] Adds the `readPoolLifeCycleStatus` function to the pool DB layer, making it possible to determine the current lifecycle status of a pool. 

- [x] Updates the `retirement` field of `ApiStakePool` with live information.

# Property Tests

This PR adds property tests to ensure that:

- [x] the `determinePoolLifeCycleStatus` function respects the correct order of precedence for registration and retirement certificates:
    - for a given pool, a registration certificate always _supercedes_ a prior retirement certificate.
    - for a given pool, a retirement certificate always _augments_ the latest registration certificate.
- [x] `readPoolLifeCycleStatus` queries work correctly in the presence of blocks containing multiple certificates for the same pool.
- [x] database rollback works correctly in the presence of retirement certificates.

# Future Work

A **_future_** PR will add integration tests to ensure that:

- retiring a pool eventually results in a correct update to the `retirement` field of `ApiStakePool`, when read through the `ListStakePools` operation.
- retiring and then re-registering a pool clears the `retirement` field. 

See QA section of https://github.com/input-output-hk/cardano-wallet/issues/1819.

Co-authored-by: Jonathan Knowles <[email protected]>
Merge #1847
1847: Track Stakepool Retirements in the DB r=jonathanknowles a=jonathanknowles

# Related Issues

#1815 
#1816 
#1817 
#1819 
#1880 

# Overview

This PR:

- [x] Extends the pool DB schema to make it possible to store:
    - [x] retirement certificates.
    - [x] the _order_ of publication of certificates _within the same block_, for both registration and retirement certificates. This is necessary, as the intra-block order is _significant_.<br><br>

- [x] Adds the `PoolLifeCycleStatus` type, which indicates the current lifecycle stage of a pool.

    There are currently _three_ possibilities:
    1. `NotRegistered`
        (indicates that a pool has never been registered)
    2. `Registered`
        (indicates that a pool has been registered but _not_ retired)
        (provides a registration certificate)
    3. `RegisteredAndRetired`
        (indicates that a pool has been registered _and_ retired)
        (provides both a registration and a retirement certificate)<br><br>

- [x] Adds the `readPoolLifeCycleStatus` function to the pool DB layer, making it possible to determine the current lifecycle status of a pool. 

- [x] Updates the `retirement` field of `ApiStakePool` with live information.

# Property Tests

This PR adds property tests to ensure that:

- [x] the `determinePoolLifeCycleStatus` function respects the correct order of precedence for registration and retirement certificates:
    - for a given pool, a registration certificate always _supercedes_ a prior retirement certificate.
    - for a given pool, a retirement certificate always _augments_ the latest registration certificate.
- [x] `readPoolLifeCycleStatus` queries work correctly in the presence of blocks containing multiple certificates for the same pool.
- [x] database rollback works correctly in the presence of retirement certificates.

# Future Work

A **_future_** PR will add integration tests to ensure that:

- retiring a pool eventually results in a correct update to the `retirement` field of `ApiStakePool`, when read through the `ListStakePools` operation.
- retiring and then re-registering a pool clears the `retirement` field. 

See QA section of https://github.com/input-output-hk/cardano-wallet/issues/1819.

Co-authored-by: Jonathan Knowles <[email protected]>