Skip to content

Commit

Permalink
Fix: PlutusV3 cost model issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Nov 11, 2024
1 parent 5eeb1bc commit 6a75044
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/utils/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ export class BrowserProvider implements Provider {

// Build cost models
const costModels: CostModels = new Map();
for (const cm of Object.keys(response.cost_models) as BlockfrostLanguageVersions[]) {

const costModelNoV3 = response.cost_models;

delete costModelNoV3.PlutusV3;

for (const cm of Object.keys(costModelNoV3) as BlockfrostLanguageVersions[]) {
const costModel: number[] = [];
const keys = Object.keys(response.cost_models[cm]).sort();
const keys = Object.keys(costModelNoV3[cm]).sort();
for (const key of keys) {
costModel.push(response.cost_models[cm][key]!);
costModel.push(costModelNoV3[cm][key]!);
}

costModels.set(fromBlockfrostLanguageVersion(cm), costModel);
Expand Down

0 comments on commit 6a75044

Please sign in to comment.