-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(DataIntegrityProof): extract merkle proof 2019 to its own co…
…nstructor
- Loading branch information
1 parent
6df70eb
commit 889440b
Showing
5 changed files
with
27 additions
and
9 deletions.
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
Empty file.
File renamed without changes.
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,23 @@ | ||
from datetime import datetime | ||
|
||
MERKLE_PROOF_2019_TYPE = 'MerkleProof2019' | ||
class MerkleProof2019Suite: | ||
type = '' | ||
verificationMethod = '' | ||
created = '' | ||
proofPurpose = '' | ||
previousProof = '' | ||
proofValue = '' | ||
|
||
def __init__(self, proof_value, verificationMethod): | ||
self.type = MERKLE_PROOF_2019_TYPE | ||
self.proofPurpose = 'assertionMethod' | ||
self.created = self.get_creation_time() | ||
self.proofValue = proof_value.decode('utf-8') | ||
self.verificationMethod = verificationMethod | ||
|
||
def get_creation_time(self): | ||
return datetime.now().isoformat() | ||
|
||
def to_json_object(self): | ||
return self.__dict__ |