From 995891ed5762cd6f995ebdbfac2e90e5bfb518c9 Mon Sep 17 00:00:00 2001 From: Paul Hewlett Date: Mon, 1 Jul 2024 16:59:48 +0100 Subject: [PATCH] Restore simple hash enum AB#92329 --- Dockerfile-builder | 2 +- archivist/proof_mechanism.py | 2 +- unittests/testproof_mechanism.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile-builder b/Dockerfile-builder index 0bddbe60..6d842de1 100644 --- a/Dockerfile-builder +++ b/Dockerfile-builder @@ -7,7 +7,7 @@ FROM python:${VERSION}-bookworm # .github/workflows/python-package.yml # .github/workflows/python-publish.yml # -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive RUN curl -fsSOL https://taskfile.dev/install.sh \ && sh install.sh \ diff --git a/archivist/proof_mechanism.py b/archivist/proof_mechanism.py index 5067615b..52aefcc9 100644 --- a/archivist/proof_mechanism.py +++ b/archivist/proof_mechanism.py @@ -17,6 +17,6 @@ class ProofMechanism(Enum): # previously used but now removed __RESERVED1 = 1 - __RESERVED2 = 2 + SIMPLE_HASH = 2 #: Assets and events are proven using a merkle log hash of the originator's evidence MERKLE_LOG = 3 diff --git a/unittests/testproof_mechanism.py b/unittests/testproof_mechanism.py index a6bb1a1b..95d8cedc 100644 --- a/unittests/testproof_mechanism.py +++ b/unittests/testproof_mechanism.py @@ -38,14 +38,14 @@ def test_proof_mechanism_reserved1(self): ProofMechanism.__RESERVED1.name, "__RESERVED1", msg="Incorrect value" ) - def test_proof_mechanism_reserved2(self): + def test_proof_mechanism_simple_hash(self): """ Test proof_mechanism """ - with self.assertRaises(AttributeError): - self.assertEqual(ProofMechanism.__RESERVED2.value, 2, msg="Incorrect value") + self.assertEqual(ProofMechanism.SIMPLE_HASH.value, 2, msg="Incorrect value") - with self.assertRaises(AttributeError): - self.assertEqual( - ProofMechanism.__RESERVED2.name, "__RESERVED2", msg="Incorrect value" - ) + self.assertEqual( + ProofMechanism.SIMPLE_HASH.name, + "SIMPLE_HASH", + msg="Incorrect value", + )