Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
93 stars 50 forks source link

Stop hard-coding `Costmdls` #566

Closed ngua closed 2 years ago

ngua commented 2 years ago

The PlutusV1 Costmdls are currently hard-coded in ProcolParametersAlzonzo, but it would be ideal to generate these at when the ContractConfig is initialized or when required during application lifetime

A possible approach could be:

IMPORTANT The order of the costModels fields inside ProcolParameters is not the same as the order of the Array UInt that comprises the CostModel. We need to investigate how to create the correct order

As an alternative, we could also use CSL to get both the Alonzo and Babbage-era Costmdls. This is possible now with CSL v10.x using default_costmdls and Alonzo/Babbage-specific ones are also introduced with v11.x

klntsky commented 2 years ago

Although the current approach is to query for Costmdls each time they are needed (and not putting them to ContractConfig as requested), I think this issue can be closed.