Skip to content

cardano-testnet: Replace eon-based era witnesses with Exp.IsEra/Era #6487

@Jimbo4350

Description

@Jimbo4350

Background

cardano-api has introduced a new era API in Cardano.Api.Experimental.Era built around Era era, IsEra era, and EraCommonConstraints. This replaces the older eon-based approach (BabbageEraOnwards, ConwayEraOnwards, babbageEraOnwardsConstraints, etc.), which is now deprecated — see cardano-api #938.

The new API is cleaner: rather than threading specific eon witnesses (ConwayEraOnwardsConway, etc.) through code and calling *EraOnwardsConstraints to bring constraints into scope, callers use Era era / IsEra era and obtainCommonConstraints.

Problem

cardano-testnet tests and infrastructure still use the old eon API extensively. For example, from the new gRPC integration tests in PR #6273:

let ceo = ConwayEraOnwardsConway
    sbe = convert ceo
    ...
babbageEraOnwardsConstraints (convert ceo) $ do
  ...

This should instead use Era ConwayEra / obtainCommonConstraints:

let era = ConwayEra  -- Exp.Era
    sbe = convert era
    ...
obtainCommonConstraints era $ do
  ...

Scope

Audit all of cardano-testnet (src and tests) for usage of:

  • *EraOnwards* constructors and witnesses
  • *EraOnwardsConstraints functions
  • ShelleyBasedEra* era witnesses where Era era suffices

And replace with the experimental era API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions