Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
branches: ["main", "chang"]
types: [opened, reopened, edited, synchronize]

env:
# Keep in sync with the generator recorded in the first line of poetry.lock.
# An older Poetry rejects the lock file's content hash; a newer one may rewrite it.
POETRY_VERSION: "2.4.2"

jobs:
build:

Expand All @@ -19,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -52,7 +57,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching *, i.e. 1.0, 20.15.10

env:
# Keep in sync with the generator recorded in the first line of poetry.lock.
POETRY_VERSION: "2.4.2"

jobs:
publish:
strategy:
Expand All @@ -15,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down
11 changes: 10 additions & 1 deletion pycardano/cip/cip8.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from pycardano.address import Address
from pycardano.crypto import BIP32ED25519PublicKey
from pycardano.exception import DeserializeException
from pycardano.key import (
ExtendedSigningKey,
ExtendedVerificationKey,
Expand Down Expand Up @@ -162,7 +163,15 @@ def verify(
signed_message, str
), "signed_message must be a hex string at this point"
decoded = loads(bytes.fromhex("d2" + signed_message))
assert isinstance(decoded, CBORTag) and decoded.tag == Sign1Message.cbor_tag
if (
not isinstance(decoded, CBORTag)
or decoded.tag != Sign1Message.cbor_tag
or not isinstance(decoded.value, list)
):
raise DeserializeException(
f"Expected a COSE_Sign1 message tagged {Sign1Message.cbor_tag} with an "
f"array body, got {decoded!r}."
)
decoded_message = Sign1Message.from_cose_obj(
decoded.value, allow_unknown_attributes=True
)
Expand Down
Loading
Loading