@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
24 lines (19 loc) • 960 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.phoist = void 0;
function phoist(closedTerm) {
/*
the implementation has been moved to a method of the term
since all 'phoist' is doing is wrapping whatever UPLC the 'Term' represent
into an 'HoistedUPLC'
however proevious implementaiton achieved this by creating a new term and then **copying** eventual extension
this was a problem since the extension methods are defined using the **raw** UPLC rather than the hoisted
causing the hoisted result not to be actually hoisted if accessed using the methods
moving the "wrapping" of the 'toUPLC' method inside the term, preserves the same 'Term' object
but the same 'Term' object is now properly hoisted
this also removes the `O(n)` operation of copying the methods; since the methods are already there
*/
closedTerm.hoist();
return closedTerm;
}
exports.phoist = phoist;