@helios-lang/contract-utils
Advanced tools
Comparing version 0.2.19 to 0.2.20
{ | ||
"name": "@helios-lang/contract-utils", | ||
"version": "0.2.19", | ||
"version": "0.2.20", | ||
"description": "Convenience and type-safety utilities for using Helios validators from within Typescript", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -264,12 +264,22 @@ import { bytesToHex } from "@helios-lang/codec-utils" | ||
/** | ||
* Also returns the hash types of any hash-dependencies | ||
* @private | ||
* @param {LoadedValidator[]} validators | ||
* @returns {{[name: string]: any}} | ||
* @returns {Record<string, any>} | ||
*/ | ||
getHashTypes(validators) { | ||
return Object.fromEntries( | ||
validators.map((v) => { | ||
return [v.$name, this.lib.getScriptHashType(v.$purpose)] | ||
/** | ||
* @type {Record<string, any>} | ||
*/ | ||
const res = {} | ||
validators.forEach((v) => { | ||
res[v.$name] = this.lib.getScriptHashType(v.$purpose) | ||
v.$hashDependencies.forEach((d) => { | ||
res[d.$name] = this.lib.getScriptHashType(d.$purpose) | ||
}) | ||
) | ||
}) | ||
return res | ||
} | ||
@@ -276,0 +286,0 @@ } |
@@ -77,5 +77,6 @@ /** | ||
/** | ||
* Also returns the hash types of any hash-dependencies | ||
* @private | ||
* @param {LoadedValidator[]} validators | ||
* @returns {{[name: string]: any}} | ||
* @returns {Record<string, any>} | ||
*/ | ||
@@ -82,0 +83,0 @@ private getHashTypes; |
Sorry, the diff of this file is not supported yet
200213
5074