Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API endpoint to migrate funds from a legacy wallet. #779

Closed
9 tasks done
jonathanknowles opened this issue Oct 1, 2019 · 4 comments
Closed
9 tasks done

Add API endpoint to migrate funds from a legacy wallet. #779

jonathanknowles opened this issue Oct 1, 2019 · 4 comments
Assignees

Comments

@jonathanknowles
Copy link
Member

jonathanknowles commented Oct 1, 2019

Context

This task will provide an API endpoint that allows users to migrate their funds from a Byron wallet to a new-style wallet.

Usage

The basic sequence of a complete migration would be:

  1. Use postByronWallet to restore a Byron wallet.
  2. Use postWallet to create a new-style wallet (if one does not already exist).
  3. Use migrateByronWallet to migrate funds from the Byron wallet to the new-style wallet.
  4. Use deleteByronWallet to delete the now-empty Byron wallet.

Decision

The API will provide an endpoint similar to the following:

/byron/wallets/{byronWalletId}/migrate/{walletId}:
  post:
    operationId: migrateByronWallet
    tags: ["Wallets"]   
    summary: Migrate  
    description: |
      Migrate all funds from a Byron wallet to a new-style wallet.
    parameters:
      - *parametersByronWalletId
      - *parametersWalletId
      - <<: *parametersBody 
        schema: *ApiMigrateByronWalletData 
    responses: *responsesMigrateByronWallet

With schema definitions similar to the following:

ApiMigrateByronWalletData: &ApiMigrateByronWalletData 
  type: object
  required:
    - passphrase
  properties: 
    passphrase:
      <<: *walletPassphrase
      description: The wallet's master passphrase.

Acceptance Criteria

Within the list of criteria below, a ticked criterion indicates that there is test coverage in the master branch to demonstrate that this criterion is satisfied.

  • The API must provide a simple operation to migrate funds from a Byron wallet to a new-style wallet (the migrateByronWallet operation).
  • If the user erroneously specifies a Shelly wallet ID as the source wallet when calling migrateByronWallet, the operation must fail with an error. The error should include a user-friendly explanation informing them that they have specified the wrong type of wallet as a source wallet.
  • If the user erroneously specifies a Byron wallet ID as the target wallet when calling migrateByronWallet, the operation must fail with an error. The error should include a user-friendly explanation informing them that they have specified the wrong type of wallet as a target wallet.
  • The actual cost incurred by the migration must exactly match the cost returned by the getByronWalletMigrateInfo endpoint. Therefore, the balance of the new wallet must be equal to b - c, where b was the original balance of the legacy wallet, and c is the cost returned by getByronWalletMigrateInfo.
  • After a successful migration, data relating to the original wallet should still be present in the database.
  • After a successful migration, calling getByronWallet with the migrated wallet ID should still succeed.
  • After a successful migration, calling getByronWallet with the migrated wallet ID must report a balance of 0.
  • After a successful migration, the listByronWallets operation should still include the migrated wallet in the list it returns.

PR

Number Base
#795 master
#806 master
#871 master
#890 master
#950 master

QA

  • Build integration tests to verify that all acceptance criteria have been satisfied.
@jonathanknowles jonathanknowles added this to the Legacy Wallet Support milestone Oct 1, 2019
@jonathanknowles jonathanknowles changed the title Add API endpoint to migrate funds from a legacy wallet to a new wallet. Add API endpoint to migrate funds from a legacy wallet. Oct 1, 2019
@jonathanknowles jonathanknowles self-assigned this Oct 4, 2019
iohk-bors bot added a commit that referenced this issue Oct 10, 2019
795: Add skeletal Byron wallet API endpoints relating to migration. r=jonathanknowles a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds skeletal migration-related API endpoints for Byron-style wallets.

Further PRs will add actual implementations for these endpoints.

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 10, 2019
806: Add test example values for Byron API types. r=jonathanknowles a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds example test values for the following Byron API types:

* `ApiMigrateByronWalletData`
* `ApiByronWalletMigrationInfo`


Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 14, 2019
798: Stake pools changes to DB r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
#712 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added separate SQL schema 
- [x] I have added DBPoolLayer
- [x] I have added impl of MVar version of DBPoolLayer
- [x] I have added impl of Sqlite version of DBPoolLayer

# Comments

<!-- Additional comments or screenshots to attach if any -->
Properties to check in the next PR:
1. `putPoolProduction` of sequence of  `(poolId, SlotIdN)` where `N` is incrementing in Sqlite gives the same result upon `readPoolProduction` as when MVar impl
2. `putPoolProduction` slots being in given epoch and `readPoolProduction (Just epoch)` with this epoch should give proper results
3. `readPoolProduction (Just epoch)` for any epoch always should always only give values from a given epoch
4. When we `putPoolProduction` pools and non-duplicating slots in increasing order then we should have all pool values and all slot values when `readPoolProduction Nothing`.
5. When we `putPoolProduction` pools and non-duplicating slots in increasing order then
for each pool id we have slots value that are diminishing in time
6. `rollbackTo slotIdN` should not have slot values later than slotIdN when `readPoolProduction Nothing)  
7. `rollbackTo slotIdN` should not affect slots not later than slotIdN
8. `readPoolProduction` should not return pools with no slots, with or without rollback   
   
<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


811: Provisional integration test code for migrate Byron wallets r=piotr-iohk a=piotr-iohk

# Issue Number

#778
#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] Provisional integration test code for migrate Byron wallets + small swagger.yaml update (label `Estimate Migration Cost` for endpoint that estimates cost)


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Pawel Jakubas <[email protected]>
Co-authored-by: Piotr Stachyra <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 16, 2019
837: Change the return type of `migrateByronWallet` to be a list of transactions. r=KtorZ a=jonathanknowles

# Issue Number

#779 

# Overview

The result of migrating funds from a Byron wallet to a new-style wallet will be the creation of _one or more_ transactions. Therefore, it makes sense to report this set of transactions as the result of the `migrateByronWallet` call.

This PR merely changes the return type of the call, in order to unblock testing work.

Further PRs will actually implement this call.


Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 17, 2019
838: Add --listen-address=127.0.0.1 option r=KtorZ a=rvl

Relates to #833 

# Overview

The host option follows the specification here: http://hackage.haskell.org/package/streaming-commons-0.2.1.0/docs/Data-Streaming-Network.html#t:HostPreference

# Comments

CLI client can still only connect to localhost.


844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet
- [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ?

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


859: Relocate C.W.Jormungandr.BlockHeaders to C.W.Network.BlockHeaders r=KtorZ a=Anviking

# Issue Number

#711 


# Overview

- [x] Relocate Cardano.Wallet.Jormungandr.BlockHeaders to Cardano.Wallet.Network.BlockHeaders. `Cardano.Pool.Metrics` needs them!

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 17, 2019
844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet
- [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ?

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


859: Relocate C.W.Jormungandr.BlockHeaders to C.W.Network.BlockHeaders r=KtorZ a=Anviking

# Issue Number

#711 


# Overview

- [x] Relocate Cardano.Wallet.Jormungandr.BlockHeaders to Cardano.Wallet.Network.BlockHeaders. `Cardano.Pool.Metrics` needs them!

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 17, 2019
844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet
- [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ?

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


859: Relocate C.W.Jormungandr.BlockHeaders to C.W.Network.BlockHeaders r=KtorZ a=Anviking

# Issue Number

#711 


# Overview

- [x] Relocate Cardano.Wallet.Jormungandr.BlockHeaders to Cardano.Wallet.Network.BlockHeaders. `Cardano.Pool.Metrics` needs them!

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 17, 2019
844: Add and 'implement' "listByronTransactions" to the API r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added a `GET /byron-wallets/{walletId}/transactions` to get the list of transactions for a byron wallet
- [x] The implementation is actually the same as the one for sequential wallets, so we could consider testing done here 😅 ? @piotr-iohk ?

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 22, 2019
871: Special coin selection function for handling migration of legacy wallets r=jonathanknowles a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#778 #779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added a function to build a coin selection from an existing UTxO. The function yields multiple coin selections. Making transaction corresponding to these selection should empty the wallet. 

- [x] @jonathanknowles has implemented a series of property tests to check the correctness of the function.

# Comments

<!-- Additional comments or screenshots to attach if any -->

I've measured how "good" the migration algorithm is by comparing the sum of all funds migrated (without taking fee into account) to the initial UTxO value. So for instance `99%` means that 99% of the wallet's value was selected for migration and 1% is left behind and won't be migrated. This has been tried for various dust ratio (1% of your wallet is dust, 5% is dust, 25% is dust etc...) and, with realistic values for the fee policy.

(see https://github.com/input-output-hk/cardano-wallet/pull/871/files#diff-d067d3d9dbdfa81e932cc6fee6a9748cR66-R93)

Then, I've tried using different approaches with regards to the way we arrange the UTxO set in the migration function:

- The default one which just uses the UTxO in an arbitrary order
- Sorting the UTxO with biggest coins first
- Interleaving small and big coins

Aaaaaand.. despite our intuition, here are the results:

```
Arbitrary Order              Biggest UTxO first           Interleaving of big and small
                                                           
dust=1%                      dust=1%                      dust=1%
  93.5% PERFECT  (== 100%)     46.5% OKAY     (>   99%)     93.8% PERFECT  (== 100%)
   4.4% GREAT    (>   99%)     43.5% PERFECT  (== 100%)      4.9% OKAY     (>   99%)
   2.1% MEDIOCRE (<=  99%)      9.9% MEDIOCRE (<=  99%)      1.3% MEDIOCRE (<=  99%)
                           
dust=5%                      dust=5%                      dust=5%
  93.3% PERFECT  (== 100%)     58.7% OKAY     (>   99%)     93.6% PERFECT  (== 100%)
   4.4% GREAT    (>   99%)     32.9% PERFECT  (== 100%)      5.0% OKAY     (>   99%)
   2.3% MEDIOCRE (<=  99%)      8.4% MEDIOCRE (<=  99%)      1.4% MEDIOCRE (<=  99%)
                           
dust=10%                     dust=10%                     dust=10%
  92.8% PERFECT  (== 100%)     66.4% OKAY     (>   99%)     93.1% PERFECT  (== 100%)
   4.6% GREAT    (>   99%)     24.1% PERFECT  (== 100%)      5.1% OKAY     (>   99%)
   2.6% MEDIOCRE (<=  99%)      9.5% MEDIOCRE (<=  99%)      1.8% MEDIOCRE (<=  99%)
                           
dust=25%                     dust=25%                     dust=25%
  91.5% PERFECT  (== 100%)     75.0% OKAY     (>   99%)     89.9% PERFECT  (== 100%)
   5.0% GREAT    (>   99%)     14.4% PERFECT  (== 100%)      6.1% OKAY     (>   99%)
   3.5% MEDIOCRE (<=  99%)     10.6% MEDIOCRE (<=  99%)      4.0% MEDIOCRE (<=  99%)
                          
dust=50%                     dust=50%                     dust=50%
  86.9% PERFECT  (== 100%)     74.4% OKAY     (>   99%)     38.0% OKAY     (>   99%)
   8.2% MEDIOCRE (<=  99%)     14.8% MEDIOCRE (<=  99%)     34.7% PERFECT  (== 100%)
   4.9% GREAT    (>   99%)     10.8% PERFECT  (== 100%)     27.3% MEDIOCRE (<=  99%)
```

Sooooo... It seems that sometimes, doing less is better 😄 ... And it's already quite sufficient do not do anything and leave the UTxO in an arbitrary order). Now, if I play a bit more with the value for the `dust`, and use as a `dust` value, the constant part for the fees (the `b` in `a * x + b` in the fee equation), we end up with:

```
    dust=1%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=5%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=10%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=25%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=50%
      +++ OK, passed 1000 tests:
      99.6% PERFECT  (== 100%)
       0.4% OKAY     (>   99%)
```

Which clearly gives us some indication about what a good value for the `dustThreshold` should be 😄 

> ℹ️  It would be interesting to take the price of the migration into account too in the comparison. Perhaps one selects less coins, but, also generate less transactions which results in more money being transferred 🤔 ?

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 22, 2019
871: Special coin selection function for handling migration of legacy wallets r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#778 #779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added a function to build a coin selection from an existing UTxO. The function yields multiple coin selections. Making transaction corresponding to these selection should empty the wallet. 

- [x] @jonathanknowles has implemented a series of property tests to check the correctness of the function.

# Comments

<!-- Additional comments or screenshots to attach if any -->

I've measured how "good" the migration algorithm is by comparing the sum of all funds migrated (without taking fee into account) to the initial UTxO value. So for instance `99%` means that 99% of the wallet's value was selected for migration and 1% is left behind and won't be migrated. This has been tried for various dust ratio (1% of your wallet is dust, 5% is dust, 25% is dust etc...) and, with realistic values for the fee policy.

(see https://github.com/input-output-hk/cardano-wallet/pull/871/files#diff-d067d3d9dbdfa81e932cc6fee6a9748cR66-R93)

Then, I've tried using different approaches with regards to the way we arrange the UTxO set in the migration function:

- The default one which just uses the UTxO in an arbitrary order
- Sorting the UTxO with biggest coins first
- Interleaving small and big coins

Aaaaaand.. despite our intuition, here are the results:

```
Arbitrary Order              Biggest UTxO first           Interleaving of big and small
                                                           
dust=1%                      dust=1%                      dust=1%
  93.5% PERFECT  (== 100%)     46.5% OKAY     (>   99%)     93.8% PERFECT  (== 100%)
   4.4% GREAT    (>   99%)     43.5% PERFECT  (== 100%)      4.9% OKAY     (>   99%)
   2.1% MEDIOCRE (<=  99%)      9.9% MEDIOCRE (<=  99%)      1.3% MEDIOCRE (<=  99%)
                           
dust=5%                      dust=5%                      dust=5%
  93.3% PERFECT  (== 100%)     58.7% OKAY     (>   99%)     93.6% PERFECT  (== 100%)
   4.4% GREAT    (>   99%)     32.9% PERFECT  (== 100%)      5.0% OKAY     (>   99%)
   2.3% MEDIOCRE (<=  99%)      8.4% MEDIOCRE (<=  99%)      1.4% MEDIOCRE (<=  99%)
                           
dust=10%                     dust=10%                     dust=10%
  92.8% PERFECT  (== 100%)     66.4% OKAY     (>   99%)     93.1% PERFECT  (== 100%)
   4.6% GREAT    (>   99%)     24.1% PERFECT  (== 100%)      5.1% OKAY     (>   99%)
   2.6% MEDIOCRE (<=  99%)      9.5% MEDIOCRE (<=  99%)      1.8% MEDIOCRE (<=  99%)
                           
dust=25%                     dust=25%                     dust=25%
  91.5% PERFECT  (== 100%)     75.0% OKAY     (>   99%)     89.9% PERFECT  (== 100%)
   5.0% GREAT    (>   99%)     14.4% PERFECT  (== 100%)      6.1% OKAY     (>   99%)
   3.5% MEDIOCRE (<=  99%)     10.6% MEDIOCRE (<=  99%)      4.0% MEDIOCRE (<=  99%)
                          
dust=50%                     dust=50%                     dust=50%
  86.9% PERFECT  (== 100%)     74.4% OKAY     (>   99%)     38.0% OKAY     (>   99%)
   8.2% MEDIOCRE (<=  99%)     14.8% MEDIOCRE (<=  99%)     34.7% PERFECT  (== 100%)
   4.9% GREAT    (>   99%)     10.8% PERFECT  (== 100%)     27.3% MEDIOCRE (<=  99%)
```

Sooooo... It seems that sometimes, doing less is better 😄 ... And it's already quite sufficient do not do anything and leave the UTxO in an arbitrary order). Now, if I play a bit more with the value for the `dust`, and use as a `dust` value, the constant part for the fees (the `b` in `a * x + b` in the fee equation), we end up with:

```
    dust=1%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=5%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=10%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=25%
      +++ OK, passed 1000 tests (100.0% PERFECT  (== 100%)).
    dust=50%
      +++ OK, passed 1000 tests:
      99.6% PERFECT  (== 100%)
       0.4% OKAY     (>   99%)
```

Which clearly gives us some indication about what a good value for the `dustThreshold` should be 😄 

> ℹ️  It would be interesting to take the price of the migration into account too in the comparison. Perhaps one selects less coins, but, also generate less transactions which results in more money being transferred 🤔 ?

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 22, 2019
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl

Relates to #832 and #848.
Supersedes #850.

# Overview

`cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). 

# Comments

The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet.


864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it.

# Comments

<!-- Additional comments or screenshots to attach if any -->

Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... 

[jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82)
```rust
            WitnessType::OldUTxO => {
                // TODO unimplemented!()
                let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?;
                Err(Error::MakeWitnessLegacyUtxoUnsupported)?;
                unimplemented!()
            }
``` 

so I had to construct them by hand according to:

- The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses)

- The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176)

It'd be nice to review our golden if / when the constructor for the witness type gets updated.

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


879: Porting the rest of forget pending tx integration tests to CLI r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
#836 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have ported the rest of forgetting pending tx integration tests to CLI

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 22, 2019
862: jormungandr launch: use --rest-listen instead of generating config.yaml r=KtorZ a=rvl

Relates to #832 and #848.
Supersedes #850.

# Overview

`cardano-wallet-jormungandr launch` specifies the REST API port and storage directory. The user provides the rest of the Jörmungandr configuration (e.g. trusted peers). 

# Comments

The Jörmungandr P2P listen address, port, and log level are no longer configured by cardano-wallet.


864: nix: Provide derivations for Daedalus installer r=KtorZ a=rvl

Relates to #863.
Based on #828.

# Overview

- @disassembler @cleverca22 It's not exactly the same as before but should work ok I think.
- Adds source filtering to avoid unnecessary rebuilds.

# Comments

To build:

```
nix-build -A cardano-wallet-jormungandr
nix-build release.nix -A daedalus-jormungandr.windows -o daedalus-jormungandr-windows
nix-build release.nix -A daedalus-jormungandr.macos -o daedalus-jormungandr-macos
nix-build release.nix -A daedalus-jormungandr.linux -o daedalus-jormungandr-linux
```

Note that `daedalus-jormungandr.{windows,macos,linux}` from `release.nix` reference the same `cardano-wallet-jormungandr` derivation, only with different `system` or `crossSystem` arguments. So Daedalus may also import from `default.nix` rather than `release.nix`.

878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it.

# Comments

<!-- Additional comments or screenshots to attach if any -->

Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... 

[jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82)
```rust
            WitnessType::OldUTxO => {
                // TODO unimplemented!()
                let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?;
                Err(Error::MakeWitnessLegacyUtxoUnsupported)?;
                unimplemented!()
            }
``` 

so I had to construct them by hand according to:

- The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses)

- The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176)

It'd be nice to review our golden if / when the constructor for the witness type gets updated.

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


879: Porting the rest of forget pending tx integration tests to CLI r=KtorZ a=paweljakubas

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->
#836 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have ported the rest of forgetting pending tx integration tests to CLI

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Rodney Lorrimar <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 22, 2019
878: Support for legacy UTxO witness in Jörmungandr r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have extended `mkStdTx` so that it would properly handle transactions coming from a `RndKey` and construct `legacy-utxo` witnesses for it.

# Comments

<!-- Additional comments or screenshots to attach if any -->

Jörmungandr doesn't implement creating legacy utxo witnesses from jcli ... 

[jcli/src/jcli_app/transaction/mk_witness.rs](https://github.com/input-output-hk/jormungandr/blob/master/jcli/src/jcli_app/transaction/mk_witness.rs#L78-L82)
```rust
            WitnessType::OldUTxO => {
                // TODO unimplemented!()
                let _secret_key: SecretKey<Ed25519Bip32> = self.secret()?;
                Err(Error::MakeWitnessLegacyUtxoUnsupported)?;
                unimplemented!()
            }
``` 

so I had to construct them by hand according to:

- The format defined in [chain-impl-mockchain#witnesses](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/doc/format.md#witnesses)

- The format from the source (double checking it matches the doc..) [chain-impl-mockchain/src/transaction/witness.rs](https://github.com/input-output-hk/chain-libs/blob/incentive/chain-impl-mockchain/src/transaction/witness.rs#L173-L176)

It'd be nice to review our golden if / when the constructor for the witness type gets updated.

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 23, 2019
882: Add handlers for Byron migration r=KtorZ a=paweljakubas

# Issue Number

#778 (`migrateByronWallet`)
#779 (`getByronWalletMigrationInfo`)

# Overview

This PR:

- [x] Adds a handler for `getByronWalletMigrationInfo`.
- [x] Adds a handler for `migrateByronWallet`.

# Not included in this PR (reserved for future PRs)

- More user-friendly error handling for the case where a user attempts to migrate _**from**_ a known Shelley wallet, or _**to**_ a known Byron wallet. (We can only migrate from Byron to Shelley.)
- A complete set of integration tests. We can add these in a further PR.


<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


884: More integration tests for Byron wallets r=KtorZ a=piotr-iohk


# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->


# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] More integration tests for Byron wallets ensuring that Shelley endpoints/CLI cannot manage them


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Pawel Jakubas <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: Piotr Stachyra <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 23, 2019
882: Add handlers for Byron migration r=KtorZ a=paweljakubas

# Issue Number

#778 (`migrateByronWallet`)
#779 (`getByronWalletMigrationInfo`)

# Overview

This PR:

- [x] Adds a handler for `getByronWalletMigrationInfo`.
- [x] Adds a handler for `migrateByronWallet`.

# Not included in this PR (reserved for future PRs)

- More user-friendly error handling for the case where a user attempts to migrate _**from**_ a known Shelley wallet, or _**to**_ a known Byron wallet. (We can only migrate from Byron to Shelley.)
- A complete set of integration tests. We can add these in a further PR.


<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Pawel Jakubas <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Oct 24, 2019
849: Enable faucet random wallets r=piotr-iohk a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added faucet random wallets for Jörmungandr
- [x] Faucet wallets can be restored via `fixtureByronWallet`, although, we can't make transactions with them.

# Comments

<!-- Additional comments or screenshots to attach if any -->

:warning: Somehow, I can't generate the genesis block from the genesis
configuration, jcli isn't happy with the `legacy_fund`, am I missing
something?


<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Piotr Stachyra <[email protected]>
iohk-bors bot added a commit that referenced this issue Nov 1, 2019
916: Byron migration integration tests r=KtorZ a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds integration tests to verify that:

- [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](#778)) returns a value of `0`.
- [x] Migrating an empty wallet (with the [`migrateByronWallet`](#779) endpoint) should not generate any transactions.
- [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](#778) endpoint.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Nov 5, 2019
950: Test that `migrateByronWallet` depletes all funds from a source wallet. r=KtorZ a=jonathanknowles

# Issue Number

#779 

# Overview

This PR tests that after a successful call to `migrateByronWallet`, all funds are debited from the source wallet, leaving a balance of `0`.

# Further work

A further PR will test that funds are appropriately credited to the target wallet.

Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
iohk-bors bot added a commit that referenced this issue Nov 5, 2019
950: Test that `migrateByronWallet` depletes all funds from a source wallet. r=KtorZ a=jonathanknowles

# Issue Number

#779 

# Overview

This PR tests that after a successful call to `migrateByronWallet`, all funds are debited from the source wallet, leaving a balance of `0`.

# Further work

A further PR will test that funds are appropriately credited to the target wallet.

Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
Co-authored-by: KtorZ <[email protected]>
iohk-bors bot added a commit that referenced this issue Nov 6, 2019
950: Test that `migrateByronWallet` migrates funds correctly. r=jonathanknowles a=jonathanknowles

# Issue Number

#779 

# Overview

This PR tests that after a successful call to `migrateByronWallet`:

- [x] all funds are debited from the source wallet, leaving a balance of `0`.
- [x] all funds are eventually credited to the target wallet, minus the fee.
- [x] the resultant fee is the same as the fee predicted by `getByronWalletMigrateInfo`.

Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
Co-authored-by: KtorZ <[email protected]>
@piotr-iohk
Copy link
Contributor

piotr-iohk commented Nov 6, 2019

I have reviewed integration tests, they are quite nice.

I would like to add few more mostly around negative cases (BYRON_MIGRATE and BYRON_CALCULATE in the file): https://docs.google.com/spreadsheets/d/1fadIA_j4nCd3FbylPo5J8K9Fy6tixSC2T9V3xHKuUvU/edit#gid=0
I don't see many tests for caluclating migration cost too. (they are touched in the BYRON_MIGRATE suite)

Also testing of of big wallet with many transactions and fragmented utxo from genesis file would be beneficial.

Also response codes might be not complete for byron migrate (https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/migrateByronWallet) I think 415 might be missing.

iohk-bors bot added a commit that referenced this issue Nov 6, 2019
966: More tests for byron wallets migration, in particular migrating from big wallets r=piotr-iohk a=KtorZ

# Issue Number

<!-- Put here a reference to the issue this PR relates to and which requirements it tackles -->

#779 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] I have added an extra integration scenario to test migrating a big wallet with a lot of dust
- [x] I have revised byron migrate response behavior when trying to migrate an empty wallet to return a 403. Two reasons for this: this is more semantically correct. It prevents some extra code needed to handle possible errors that could have occurred if we indeed tried migrating (like, an invalid passphrase).
- [x] enable a currently pending test in BYRON_TX_LIST which required faucet
- [x] Added extra negative scenario to check migrating with a wrong passphrase 
- [x] Revised endpoints status in swagger.yaml + added missing error code in migration response

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: KtorZ <[email protected]>
@jonathanknowles
Copy link
Member Author

jonathanknowles commented Nov 7, 2019

@piotr-iohk wrote:

I don't see many tests for calculating migration cost too.

Good point. It's true that we don't have many tests to trigger a migration cost calculation in the integration layer.

Though have you seen the property tests for migration coin selection?

The GetByronWalletMigrationInfo endpoint is basically a wrapper around the selectCoinsForMigration function.

Can you see any deficiencies in the set of property tests above? If so, perhaps we can flesh them out a bit more.

iohk-bors bot added a commit that referenced this issue Nov 7, 2019
973: Make large numbers more readable. r=Anviking a=jonathanknowles

# Issue Number

Related to #779.

# Overview

Just a tiny PR to make some large numbers more readable.

Co-authored-by: Jonathan Knowles <[email protected]>
iohk-bors bot added a commit that referenced this issue Nov 7, 2019
973: Make large numbers more readable. r=Anviking a=jonathanknowles

# Issue Number

Related to #779.

# Overview

Just a tiny PR to make some large numbers more readable.

Co-authored-by: Jonathan Knowles <[email protected]>
@piotr-iohk
Copy link
Contributor

@jonathanknowles I think property tests look good. I have added a few more integration tests in #989.

iohk-bors bot added a commit that referenced this issue Nov 9, 2019
989: re-organize and add few new integration tests for byron calculate/migrate r=KtorZ a=piotr-iohk

# Issue Number

#779

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] I have re-organized a bit and added few new integration test cases for byron migration/fee calculation to match with https://docs.google.com/spreadsheets/d/1fadIA_j4nCd3FbylPo5J8K9Fy6tixSC2T9V3xHKuUvU


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Piotr Stachyra <[email protected]>
@piotr-iohk
Copy link
Contributor

I have added yet additional tests in #1008 and an issue #1007 that actually was inspired by this comment #989 (comment).

Closing this one.

iohk-bors bot added a commit that referenced this issue Nov 12, 2019
1008: Additional tests for migrating and calculating migration cost for wallets containing only dust r=piotr-iohk a=piotr-iohk



# Issue Number

#779 
#1007

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] Added additional tests for attempting to migrate and calculate migration cost for dust wallets. Those special wallets added to `genesis.yaml`


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Piotr Stachyra <[email protected]>
Co-authored-by: Pawel Jakubas <[email protected]>
jonathanknowles added a commit to IntersectMBO/cardano-coin-selection that referenced this issue Feb 25, 2020
916: Byron migration integration tests r=KtorZ a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds integration tests to verify that:

- [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`.
- [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions.
- [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
jonathanknowles added a commit to IntersectMBO/cardano-coin-selection that referenced this issue Feb 25, 2020
916: Byron migration integration tests r=KtorZ a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds integration tests to verify that:

- [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`.
- [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions.
- [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
jonathanknowles added a commit to IntersectMBO/cardano-coin-selection that referenced this issue Feb 25, 2020
916: Byron migration integration tests r=KtorZ a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds integration tests to verify that:

- [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`.
- [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions.
- [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
jonathanknowles added a commit to IntersectMBO/cardano-coin-selection that referenced this issue Feb 25, 2020
916: Byron migration integration tests r=KtorZ a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds integration tests to verify that:

- [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`.
- [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions.
- [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
jonathanknowles added a commit to IntersectMBO/cardano-coin-selection that referenced this issue Feb 25, 2020
916: Byron migration integration tests r=KtorZ a=jonathanknowles

# Issue Number

#778 
#779 

# Overview

This PR adds integration tests to verify that:

- [x] Calculating the migration cost of an empty wallet (with [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778)) returns a value of `0`.
- [x] Migrating an empty wallet (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) should not generate any transactions.
- [x] The actual cost incurred by a migration (with the [`migrateByronWallet`](cardano-foundation/cardano-wallet#779) endpoint) **exactly** matches the cost returned by the [`getByronWalletMigrateInfo`](cardano-foundation/cardano-wallet#778) endpoint.

# Comments

<!-- Additional comments or screenshots to attach if any -->

<!-- 
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Jonathan Knowles <[email protected]>
Co-authored-by: KtorZ <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants