Skip to content

Commit b1fea75

Browse files
authored
Merge pull request #32 from dbluhm/fix/integrations
feat: verification method types can report type
2 parents 6b54afa + 19ad7ea commit b1fea75

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

pydid/verification_method.py

+5
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ def material(self, value):
163163
)
164164
return setattr(self, self._material_prop, value)
165165

166+
@classmethod
167+
def method_type(cls) -> Optional[str]:
168+
"""Return method type if known."""
169+
return cls._fill_in_required_literals().get("type")
170+
166171

167172
# Verification Method Suites registered in DID Spec
168173

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ show_missing = true
2121

2222
[tool.poetry]
2323
name = "pydid"
24-
version = "0.2.5"
24+
version = "0.3.0-pre.3"
2525
description = "Python library for validating, constructing, and representing DIDs and DID Documents"
2626
authors = ["Daniel Bluhm <[email protected]>"]
2727
license = "Apache 2.0"

tests/test_verification_method.py

+4
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,7 @@ def test_infer_material():
178178
}
179179
vmethod = VerificationMethod.deserialize(vmethod_raw)
180180
assert vmethod.material == vmethod_raw["blockchainAccountId"]
181+
182+
183+
def test_method_type():
184+
assert Ed25519VerificationKey2018.method_type() == "Ed25519VerificationKey2018"

0 commit comments

Comments
 (0)