@helios-lang/contract-utils 0.2.47 → 0.2.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helios-lang/contract-utils",
3
- "version": "0.2.47",
3
+ "version": "0.2.48",
4
4
  "description": "Convenience and type-safety utilities for using Helios validators from within Typescript",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
package/src/cast/Cast.js CHANGED
@@ -247,7 +247,8 @@ function schemaToUplc(schema, x, defs = {}) {
247
247
  }
248
248
  })
249
249
 
250
- return new MapData(pairs)
250
+ // wrapped in ConstrData
251
+ return new ConstrData(0, [new MapData(pairs)])
251
252
  }
252
253
  default:
253
254
  throw new Error(
@@ -426,7 +427,10 @@ function uplcToSchema(schema, data, config, defs = {}) {
426
427
  )
427
428
  }
428
429
  case "map": {
429
- const entries = MapData.expect(data).items
430
+ // wrapped in ConstrData
431
+ const entries = MapData.expect(
432
+ ConstrData.expect(data).fields[0]
433
+ ).items
430
434
 
431
435
  if (entries.length != schema.fieldTypes.length) {
432
436
  throw new Error(
@@ -1 +1 @@
1
- {"version":3,"file":"Cast.d.ts","sourceRoot":"","sources":["../../src/cast/Cast.js"],"names":[],"mappings":"AAwgBA;;;;;;GAMG;AACH,kGAHW,UAAU,8BASpB;AAjfD;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;GAGG;AACH;IAaI;;;OAGG;IACH,oBAHW,UAAU,UACV,UAAU,EAKpB;IAnBD;;;OAGG;IACH,iBAFU,UAAU,CAEd;IAEN;;;OAGG;IACH,iBAFU,UAAU,CAEd;IAWN;;;OAGG;IACH,mBAHW,QAAQ,GACN,OAAO,CAInB;IAED;;;OAGG;IACH,cAHW,WAAW,GACT,QAAQ,CAIpB;CACJ;uBAhEY,OAAO,mBAAmB,EAAE,QAAQ;yBACpC,OAAO,qBAAqB,EA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