Skip to content

EvaluateTx function returns an empty slice due to JSON field tags mismatch #53

@MIxAxIM

Description

@MIxAxIM

Describe the bug
The ExecutionUnits struct has JSON field tags with incorrect capitalization. The JSON response received contains lowercase keys ('mem' and 'steps'), while the struct expects 'Mem' and 'Steps', causing a mismatch. As a result, the EvaluateTx function returns an empty slice. Additionally, replacing []models.RedeemerEvaluation with models.EvaluateTxResponse in the EvaluateTx function improves consistency and readability.

To Reproduce

Steps to reproduce the behavior:

  1. Try EvaluateTx function
  2. The example response is
[{"redeemer_tag":"mint","redeemer_index":0,"ex_units":{"mem":745242,"steps":186570312}}]
  1. Unmarshaling doesn't work
  2. Go to models/transactions.go
  3. check ExecutionUnits struct has a different JSON tag

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