The PlutusV1Costmdls 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:
keep Costmdls inside ContractConfig
after initializing the Ogmios websocket, use the functionality to be introduced in #541 to get the costModels field
convert this into our Costmdls type and set the field
IMPORTANT The order of the costModels fields inside ProcolParametersis 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
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.
The
PlutusV1
Costmdls
are currently hard-coded inProcolParametersAlzonzo
, but it would be ideal to generate these at when theContractConfig
is initialized or when required during application lifetimeA possible approach could be:
Costmdls
insideContractConfig
costModels
fieldCostmdls
type and set the fieldIMPORTANT The order of the
costModels
fields insideProcolParameters
is not the same as the order of theArray UInt
that comprises theCostModel
. We need to investigate how to create the correct orderAs an alternative, we could also use CSL to get both the Alonzo and Babbage-era
Costmdls
. This is possible now with CSL v10.x usingdefault_costmdls
and Alonzo/Babbage-specific ones are also introduced with v11.x