-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix aliased list (PValue) utility definition
- Loading branch information
1 parent
996307e
commit 0a7748f
Showing
6 changed files
with
50 additions
and
19 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
packages/onchain/src/pluts/lib/__tests__/Syntax.plet.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { DataI } from "@harmoniclabs/plutus-data"; | ||
import { compile, int, passert, pData, perror, pfn, plet, pmatch, PScriptContext, PTxOut, punIData, PValue, Term, termTypeToString, unit } from "../.." | ||
|
||
test("plet keeps utility", () => { | ||
|
||
const contract = pfn([ | ||
PTxOut.type | ||
], unit) | ||
((input) => { | ||
|
||
const ownValue = plet( input.value ); | ||
|
||
expect( ownValue.lovelaces instanceof Term ).toBe( true ); | ||
expect( typeof ownValue.amountOf === "function" ).toBe( true ); | ||
|
||
const isValueLocked = ( | ||
ownValue.lovelaces.lt( 100 ) | ||
); | ||
|
||
return passert.$( isValueLocked ); | ||
}) | ||
|
||
const compiled = compile( contract ); | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters