diff --git a/packages/offchain/src/__tests__/TxBuilder.build.fee.test.ts b/packages/offchain/src/__tests__/TxBuilder.build.fee.test.ts index 45b0049f..64885522 100644 --- a/packages/offchain/src/__tests__/TxBuilder.build.fee.test.ts +++ b/packages/offchain/src/__tests__/TxBuilder.build.fee.test.ts @@ -61,7 +61,7 @@ describe("fee", () => { }); expect( tx.body.fee ).toBeGreaterThanOrEqual( 174611 ); - console.log( JSON.stringify( tx.toJson(), undefined, 2) ) + // console.log( JSON.stringify( tx.toJson(), undefined, 2) ) }); }) \ No newline at end of file diff --git a/packages/onchain/src/IR/IRNodes/IRApp.ts b/packages/onchain/src/IR/IRNodes/IRApp.ts index 9d5c24ce..e1e19b34 100644 --- a/packages/onchain/src/IR/IRNodes/IRApp.ts +++ b/packages/onchain/src/IR/IRNodes/IRApp.ts @@ -159,15 +159,15 @@ export class IRApp _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRConst.ts b/packages/onchain/src/IR/IRNodes/IRConst.ts index 9fee374a..b4abb80c 100644 --- a/packages/onchain/src/IR/IRNodes/IRConst.ts +++ b/packages/onchain/src/IR/IRNodes/IRConst.ts @@ -112,15 +112,15 @@ export class IRConst _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRDelayed.ts b/packages/onchain/src/IR/IRNodes/IRDelayed.ts index d1d3747b..113f7773 100644 --- a/packages/onchain/src/IR/IRNodes/IRDelayed.ts +++ b/packages/onchain/src/IR/IRNodes/IRDelayed.ts @@ -124,15 +124,15 @@ export class IRDelayed _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRError.ts b/packages/onchain/src/IR/IRNodes/IRError.ts index f8580470..f65e6e4a 100644 --- a/packages/onchain/src/IR/IRNodes/IRError.ts +++ b/packages/onchain/src/IR/IRNodes/IRError.ts @@ -61,15 +61,15 @@ export class IRError _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRForced.ts b/packages/onchain/src/IR/IRNodes/IRForced.ts index 7167e527..fdac2398 100644 --- a/packages/onchain/src/IR/IRNodes/IRForced.ts +++ b/packages/onchain/src/IR/IRNodes/IRForced.ts @@ -124,15 +124,15 @@ export class IRForced _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRFunc.ts b/packages/onchain/src/IR/IRNodes/IRFunc.ts index 72c6935e..c2b9b565 100644 --- a/packages/onchain/src/IR/IRNodes/IRFunc.ts +++ b/packages/onchain/src/IR/IRNodes/IRFunc.ts @@ -154,15 +154,15 @@ export class IRFunc _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRHoisted.ts b/packages/onchain/src/IR/IRNodes/IRHoisted.ts index 3489d7f7..dc652948 100644 --- a/packages/onchain/src/IR/IRNodes/IRHoisted.ts +++ b/packages/onchain/src/IR/IRNodes/IRHoisted.ts @@ -207,15 +207,15 @@ export class IRHoisted _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRLetted.ts b/packages/onchain/src/IR/IRNodes/IRLetted.ts index 80f16dbd..4bcbd05a 100644 --- a/packages/onchain/src/IR/IRNodes/IRLetted.ts +++ b/packages/onchain/src/IR/IRNodes/IRLetted.ts @@ -316,15 +316,15 @@ export class IRLetted _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRNative/index.ts b/packages/onchain/src/IR/IRNodes/IRNative/index.ts index e7fb6a4d..fd60b594 100644 --- a/packages/onchain/src/IR/IRNodes/IRNative/index.ts +++ b/packages/onchain/src/IR/IRNodes/IRNative/index.ts @@ -76,15 +76,15 @@ export class IRNative _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/IRNodes/IRVar.ts b/packages/onchain/src/IR/IRNodes/IRVar.ts index 5d0ce90f..a6308c79 100644 --- a/packages/onchain/src/IR/IRNodes/IRVar.ts +++ b/packages/onchain/src/IR/IRNodes/IRVar.ts @@ -136,15 +136,15 @@ export class IRVar _parent = newParent; // if has old parent - if( oldParent !== undefined && isIRParentTerm( oldParent ) ) - { - // change reference to a clone for safety - _modifyChildFromTo( - oldParent, - this, - this.clone() - ); - } + // if( oldParent !== undefined && isIRParentTerm( oldParent ) ) + // { + // // change reference to a clone for safety + // _modifyChildFromTo( + // oldParent, + // this, + // this.clone() + // ); + // } }, enumerable: true, configurable: false diff --git a/packages/onchain/src/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.ts b/packages/onchain/src/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.ts index 3b4f72ec..b2279b80 100644 --- a/packages/onchain/src/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.ts +++ b/packages/onchain/src/IR/toUPLC/subRoutines/replaceNatives/nativeToIR.ts @@ -26,6 +26,7 @@ const innerZ = new IRFunc( 1, // f ) ) ); +innerZ.hash; const hoisted_z_comb = new IRHoisted( new IRFunc( 1, // Z @@ -35,6 +36,7 @@ const hoisted_z_comb = new IRHoisted( ) ) ); +hoisted_z_comb.hash; const hoisted_matchList = new IRHoisted( new IRFunc( 3, @@ -60,6 +62,7 @@ const hoisted_matchList = new IRHoisted( ) ) ); +hoisted_matchList.hash; const hoisted_lazyIfThenElse = new IRHoisted( new IRFunc( 3, // condition, delayed_caseTrue, delayed_caseFalse @@ -73,6 +76,7 @@ const hoisted_lazyIfThenElse = new IRHoisted( ) ) ); +hoisted_lazyIfThenElse.hash; const hoisted_dropList = new IRHoisted( new IRApp( @@ -110,6 +114,7 @@ const hoisted_dropList = new IRHoisted( ) ) ); +hoisted_dropList.hash; const hoisted_recursiveList = new IRHoisted( new IRApp( @@ -139,6 +144,7 @@ const hoisted_recursiveList = new IRHoisted( ) ) ); +hoisted_recursiveList.hash; const hoisted_lazyOr = new IRHoisted( new IRFunc( 2, // a, b @@ -150,6 +156,7 @@ const hoisted_lazyOr = new IRHoisted( ) ) ); +hoisted_lazyOr.hash; const hoisted_lazyAnd = new IRHoisted( new IRFunc( 2, // a, b @@ -161,6 +168,7 @@ const hoisted_lazyAnd = new IRHoisted( ) ) ); +hoisted_lazyAnd.hash; const hoisted_foldr = new IRHoisted( new IRFunc( 2, // reduceFunc, accmulator @@ -186,6 +194,7 @@ const hoisted_foldr = new IRHoisted( ) ) ); +hoisted_foldr.hash; export function nativeToIR( native: IRNative ): IRTerm { diff --git a/packages/onchain/src/IR/utils/showIR.ts b/packages/onchain/src/IR/utils/showIR.ts index b557682c..e82181e0 100644 --- a/packages/onchain/src/IR/utils/showIR.ts +++ b/packages/onchain/src/IR/utils/showIR.ts @@ -111,7 +111,7 @@ export function showIR( _ir: IRTerm ) lettedHashes.push( hash.slice() as IRHash ); - getHoistedTerms( l.value.clone() ).forEach( ({ hoisted }) => addHoisted( hoisted ) ); + getHoistedTerms( l.value ).forEach( ({ hoisted }) => addHoisted( hoisted ) ); Object.defineProperty( letted, irHashToHex( hash ), { @@ -262,7 +262,7 @@ export function prettyIR( _ir: IRTerm, _indent = 2 ) : PrettiedIR lettedHashes.push( hash.slice() as IRHash ); - getHoistedTerms( l.value.clone() ).forEach( ({ hoisted }) => addHoisted( hoisted ) ); + getHoistedTerms( l.value ).forEach( ({ hoisted }) => addHoisted( hoisted ) ); const hashStr = irHashToHex( hash ); Object.defineProperty( diff --git a/packages/onchain/src/pluts/lib/builtins/_pflipIR.ts b/packages/onchain/src/pluts/lib/builtins/_pflipIR.ts index 1ca4a97a..1c586601 100644 --- a/packages/onchain/src/pluts/lib/builtins/_pflipIR.ts +++ b/packages/onchain/src/pluts/lib/builtins/_pflipIR.ts @@ -14,4 +14,5 @@ export const _pflipIR = new IRHoisted( new IRVar( 1 ) // secondArg ) ) -); \ No newline at end of file +); +_pflipIR.hash; \ No newline at end of file diff --git a/packages/onchain/src/pluts/lib/pmatch/getElemAtTerm.ts b/packages/onchain/src/pluts/lib/pmatch/getElemAtTerm.ts index 5fb4fe81..c1da2f4f 100644 --- a/packages/onchain/src/pluts/lib/pmatch/getElemAtTerm.ts +++ b/packages/onchain/src/pluts/lib/pmatch/getElemAtTerm.ts @@ -49,6 +49,7 @@ export function getElemAtTerm( n: number ): TermFn<[ PList ], PData > const term = new Term( lam( list(data), data ), _dbn => uplc ); + uplc.hash; defineReadOnlyProperty( term, "$", ( lst: Term>) => diff --git a/packages/onchain/src/pluts/lib/pmatch/matchNCtors.ts b/packages/onchain/src/pluts/lib/pmatch/matchNCtors.ts index b14fa152..c6e4dc31 100644 --- a/packages/onchain/src/pluts/lib/pmatch/matchNCtors.ts +++ b/packages/onchain/src/pluts/lib/pmatch/matchNCtors.ts @@ -99,6 +99,7 @@ export function matchNCtorsIdxs( _n: number, returnT: TermType ): Term type ContinuationT = LamT<[PrimType.List, [PrimType.Data]], TermType> + body.hash; const term = new Term( fn([ data, diff --git a/packages/onchain/src/pluts/lib/pmatch/matchSingleCtorStruct.ts b/packages/onchain/src/pluts/lib/pmatch/matchSingleCtorStruct.ts index 3c72ee2d..11b546a6 100644 --- a/packages/onchain/src/pluts/lib/pmatch/matchSingleCtorStruct.ts +++ b/packages/onchain/src/pluts/lib/pmatch/matchSingleCtorStruct.ts @@ -25,6 +25,7 @@ const hoisted_getFields = new IRHoisted( ) ) ); +hoisted_getFields.hash; export const getFields = new Term>>( lam( data, list( data ) ), diff --git a/packages/onchain/src/pluts/lib/std/UtilityTerms/TermStruct.ts b/packages/onchain/src/pluts/lib/std/UtilityTerms/TermStruct.ts index 4e003abb..9bf41f45 100644 --- a/packages/onchain/src/pluts/lib/std/UtilityTerms/TermStruct.ts +++ b/packages/onchain/src/pluts/lib/std/UtilityTerms/TermStruct.ts @@ -64,6 +64,7 @@ const hoisted_getFields = new IRHoisted( "hoisted_getFields" ) ); +hoisted_getFields.hash; export function addPStructMethods< SDef extends StructDefinition,