@harmoniclabs/plu-ts-offchain
Advanced tools
Comparing version 0.1.13-dev12 to 0.1.13-dev13
@@ -117,15 +117,5 @@ "use strict"; | ||
var utils_1 = require("./utils.js"); | ||
var scriptCache = {}; | ||
// const scriptCache: { [x: string]: UPLCTerm } = {}; | ||
function getScriptLikeUplc(scriptLike) { | ||
var script; | ||
if ((script = scriptCache[scriptLike.hash]) === undefined) { | ||
script = uplc_1.UPLCDecoder.parse(scriptLike.bytes, "flat").body; | ||
Object.defineProperty(scriptCache, scriptLike.hash, { | ||
value: script, | ||
writable: false, | ||
enumerable: true, | ||
configurable: false | ||
}); | ||
} | ||
return script; | ||
return uplc_1.UPLCDecoder.parse(scriptLike.bytes, "flat").body; | ||
} | ||
@@ -320,9 +310,12 @@ var TxBuilder = /** @class */ (function () { | ||
var ctxData = getCtx(script.type, (0, getSpendingPurposeData_1.getSpendingPurposeData)(rdmr, tx.body, expectedVersion), (0, getSpendingPurposeData_1.getScriptInfoData)(rdmr, tx.body, expectedVersion), rdmrData, txInfosV1, txInfosV2, txInfosV3); | ||
var _b = cek.eval(script.type === cardano_ledger_ts_1.ScriptType.PlutusV3 ? | ||
new uplc_1.Application(getScriptLikeUplc(script), uplc_1.UPLCConst.data(ctxData)) : | ||
new uplc_1.Application(new uplc_1.Application(getScriptLikeUplc(script), uplc_1.UPLCConst.data(rdmrData)), uplc_1.UPLCConst.data(ctxData))), result = _b.result, budgetSpent = _b.budgetSpent, logs = _b.logs; | ||
_isScriptValid = onEvaluationResult(i, totExBudget, rdmr, result, budgetSpent, logs, [ | ||
var isV2OrLess = (script.type === cardano_ledger_ts_1.ScriptType.PlutusV1 || | ||
script.type === cardano_ledger_ts_1.ScriptType.PlutusV2 || | ||
script.type === cardano_ledger_ts_1.ScriptType.NativeScript); | ||
var _b = cek.eval(isV2OrLess ? | ||
new uplc_1.Application(new uplc_1.Application(getScriptLikeUplc(script), uplc_1.UPLCConst.data(rdmrData)), uplc_1.UPLCConst.data(ctxData)) : | ||
new uplc_1.Application(getScriptLikeUplc(script), uplc_1.UPLCConst.data(ctxData))), result = _b.result, budgetSpent = _b.budgetSpent, logs = _b.logs; | ||
_isScriptValid = onEvaluationResult(i, totExBudget, rdmr, result, budgetSpent, logs, isV2OrLess ? [ | ||
rdmrData, | ||
ctxData | ||
], rdmrs, onScriptResult, onScriptInvalid); | ||
] : [ctxData], rdmrs, onScriptResult, onScriptInvalid); | ||
}; | ||
@@ -329,0 +322,0 @@ if (tag === cardano_ledger_ts_1.TxRedeemerTag.Spend) { |
{ | ||
"name": "@harmoniclabs/plu-ts-offchain", | ||
"version": "0.1.13-dev12", | ||
"version": "0.1.13-dev13", | ||
"description": "An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
260215
4851