cardano-foundation / cardano-wallet

HTTP server & command-line for managing UTxOs and HD wallets in Cardano.
Apache License 2.0
758 stars 211 forks source link

[ADP-3320] Create skeleton HTTP API for Deposit Wallet #4493

Closed HeinrichApfelmus closed 5 months ago

HeinrichApfelmus commented 5 months ago

This pull request sketches how the Cardano.Wallet.Deposit.HTTP modules related to the Cardano.Wallet.Deposit.IO modules.

Issue number

ADP-3320

HeinrichApfelmus commented 5 months ago

Also, testing of types, toy ones, against openapi spec to be added in separate PR? (could be in this or next PR of course).

Yes, we want some automated testing that the JSON encoding satisfies the OpenAPI specification. However, with FineTypes, we can get that for free if we autogenerate the OpenAPI specification for the type definitions — we do not need to do any further testing if we assume that the FineTypes code is correct. This is the reason why I have not added any testing in this skeleton PR.

I bet we are going to test properties of Wallet.listCustomer and Wallet.createAddress and in integration testing just corner cases/regressions plus http errors or thin logic that is above Wallet.* functionality logic?

Exactly. 🤓 The main tests concerning functionality will be on Cardano.Wallet.Deposit.IO — including corner cases or regressions. The testing done at the Cardano.Wallet.Deposit.HTTP level will be restricted to JSON encodings, HTTP errors, or typos when plumbing Cardano.Wallet.Deposit.IO into Cardano.Wallet.Deposit.HTTP (e.g. accidentally omitted arguments or something). As far as the "official API" goes — that will be Cardano.Wallet.Deposit.IO and Cardano.Wallet.Deposit.Pure, depending on concern (with or without IO concerns).