Skip to content

FR: Final type check in TxBuilder #205

Closed
@nielstron

Description

@nielstron

Is your feature request related to a problem? Please describe.
A lot of issues when developing arise when trying to build a transaction and accidentally passing values into the TxBuilder that are invalid. Most of the time this error can be easily caught in the TxBuilder, as it has all types already annotated but since python does not enforce these types, they are not always caught. The builder generates a bogus CBOR which is rejected by backends like ogmios with non-helpful error messages, complaining about invalid CBOR - which is hard to debug for the developer.

Describe the solution you'd like
Before building the transaction, the TxBuilder does a final typecheck on all internal attributes, raising an informative error message if anything does not match.

Describe alternatives you've considered
Maybe we can simply reload the transaction locally using from_cbor and already raise a (less informative) error there that some types don't fit?

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions