Skip to content

Commit

Permalink
expose paramsDetails as one object, with current param value encoded (#…
Browse files Browse the repository at this point in the history
…132)

- uses CBOR encoding for each type, due to internal implementation details

Co-authored-by: Randall <randall@inator.biz>
  • Loading branch information
rjharmon and Randall authored Oct 6, 2024
1 parent 728e3cd commit a704357
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/program/EntryPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { ModuleCollection } from "./ModuleCollection.js"
* mainModule: MainModule
* userTypes: Record<string, Record<string, DataType>>
* paramTypes: Record<string, DataType>
* paramsDetails(): Record<string, string>
* requiredParams: Set<string>
* changeParam(name: string, data: UplcData): boolean
* evalTypes(scriptTypes: ScriptTypes): void
Expand Down Expand Up @@ -273,6 +274,22 @@ export class EntryPointImpl {
return found
}

/**
* Presents all the parameter values as an object with keys mapping the parameter names
* to Helios declarations for each const statement, with their current settings
* @returns {Record<string, string>}
* @public
*/
paramsDetails() {
/** @type {Record<string,string>} */
const res = {}

this.loopConstStatements((name, cs) => {
res[name] = cs.toString()
})
return res
}

/**
* @returns {string}
*/
Expand Down

0 comments on commit a704357

Please sign in to comment.