Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new builtin hashing function ripemd_160 #6147

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index-state:
-- Bump both the following dates if you need newer packages from Hackage
, hackage.haskell.org 2024-01-08T22:38:30Z
-- Bump this if you need newer packages from CHaP
, cardano-haskell-packages 2024-01-16T11:00:00Z
, cardano-haskell-packages 2024-06-03T14:31:53Z

packages: doc/read-the-docs-site
plutus-benchmark
Expand Down Expand Up @@ -83,12 +83,3 @@ allow-newer:
, inline-r:containers
, inline-r:primitive

source-repository-package
type: git
location: https://github.com/paluh/cardano-base
tag: ea31e27ae4c9715232fa20e2e91f23e5bd967d65
subdir:
base-deriving-via
cardano-crypto-class
cardano-crypto-praos
cardano-crypto-tests
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Test vector (0-bit input) for Ripemd_160.
-- Output obtained using the online tool https://emn178.github.io/online-tools/ripemd_160.html
(program 1.0.0
[
[
(builtin equalsByteString)
[
(builtin ripemd_160)
(con bytestring #)
]
]
(con bytestring #9c1185a5c5e9fc54612808977ee8f548b2258d31)
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
({cpu: 2388508
| mem: 805})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 1.0.0 (con bool True))
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Test vector (0-bit input) for Ripemd_160.
-- Output obtained using the online tool https://emn178.github.io/online-tools/ripemd_160.html
(program 1.0.0
[
[
(builtin equalsByteString)
[
(builtin ripemd_160)
(con bytestring #2e7ea84da4bc4d7cfb463e3f2c8647057afff3fbececa1d200)
]
]
(con bytestring #f18921115370b049e99dfdd49fc92b371dd7c7e9)
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
({cpu: 2636077
| mem: 805})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 1.0.0 (con bool True))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI: I advocate for not using golden file machinery for programs that are expected to evaluate to a simple value like boolean True and instead verify expected result directly in the test code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to refactor this out if that is the way to go. Could you please point me to a place where I should put such a test case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI: I advocate for not using golden file machinery for programs that are expected to evaluate to a simple value like boolean True and instead verify expected result directly in the test code.

I don't think that necessarily applies here. This is in the conformance tests and by design all of those are golden tests whose input and output are textual UPLC so that they can be run by other evaluators, in particular by the Agda evaluator in plutus-metatheory.