Concordium / concordium-base

Core Rust and Haskell libraries used by various components of the Concordium blockchain, as well as some tools used for testing and development.
Mozilla Public License 2.0
22 stars 23 forks source link

Clean-up of `baker` name in the internal haskell code base #532

Closed DOBEN closed 5 months ago

DOBEN commented 5 months ago

Task description

The haskell code base still has references to bakers (e.g. in the type names). As a result, the toJSON and fromJSON implementation of the payload prints as transactionType e.g. configureBaker.

Since the name baker was replaced by validator in the public-facing APIs a while ago, the above transactionType should equally reference configureValidator (meaning more clean-up in the type names are needed in the internal haskell code base).

Alternatively, we could manually implement some toJSON/fromJSON instances for relevant types to replace the name to prevent exposing the internal type names.

https://github.com/Concordium/concordium-base/blob/91ef10f5f8d02d3ab2d07b86d8c9085281726620/haskell-src/Concordium/Types/Execution.hs#L326

https://github.com/Concordium/concordium-base/blob/91ef10f5f8d02d3ab2d07b86d8c9085281726620/haskell-src/Concordium/Types/Execution.hs#L416

DOBEN commented 5 months ago

Addressed in https://github.com/Concordium/concordium-base/pull/529/commits/a1e6511dbd56ecd76e2441ba6a245bfd09e9c7ab

by manually implementing toJSON/fromJSON for paylaod