-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vanessa McHale
committed
Mar 19, 2019
1 parent
d60ae7e
commit 3bd1737
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Main (main) where | ||
|
||
import Control.Monad (void) | ||
import qualified Data.ByteString.Lazy as BSL | ||
import Language.PlutusCore | ||
import Language.PlutusCore.Interpreter.CekMachine (runCek) | ||
import Weigh | ||
|
||
main :: IO () | ||
main = do | ||
~(f, g) <- evalFiles | ||
let processor :: BSL.ByteString -> Either (Error AlexPosn) (Program TyName Name ()) | ||
processor contents = void <$> (runQuoteT $ parseScoped contents) | ||
f' = processor f | ||
g' = processor g | ||
|
||
mainWith $ sequence_ | ||
[ func "valid" (fmap (runCek mempty)) f' | ||
, func "valid" (fmap (runCek mempty)) g' | ||
] | ||
|
||
where evalFile0 = BSL.readFile "../language-plutus-core/test/Evaluation/Golden/verifySignature.plc" | ||
evalFile1 = BSL.readFile "../language-plutus-core/test/Evaluation/Golden/verifySignatureError.plc" | ||
evalFiles = (,) <$> evalFile0 <*> evalFile1 |