Skip to content

Commit

Permalink
refactor: Small improving of the cip36 parsing (#450)
Browse files Browse the repository at this point in the history
* fix config fetching

* refactor

* add cddl validation

* fix cddl
  • Loading branch information
Mr-Leshiy authored Apr 24, 2024
1 parent a8c7f7c commit 9397ed9
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 159 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@

registration = {
key_registration = {
1 : [+delegation] / legacy_key_registration,
2 : stake_credential,
3 : payment_address,
4 : nonce,
? 5 : voting_purpose .default 0
2 : $stake_credential,
3 : $payment_address,
4 : $nonce,
? 5 : $voting_purpose .default 0
}

cip36_vote_pub_key /= bytes .size 32
payment_address /= bytes
nonce /= uint
weight /= uint .size 4
voting_purpose /= uint
legacy_key_registration = cip36_vote_pub_key
delegation = [cip36_vote_pub_key, weight]
stake_credential /= staking_pub_key
$cip36_vote_pub_key /= bytes .size 32
$payment_address /= bytes
$nonce /= uint
$weight /= uint .size 4
$voting_purpose /= uint
legacy_key_registration = $cip36_vote_pub_key
delegation = [$cip36_vote_pub_key, $weight]


$stake_credential /= $staking_pub_key
; A stake key credential, not tagged for backward compatibility
$staking_pub_key /= bytes .size 32
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
registration_witness = {
1 : stake_witness
1 : $stake_witness
}

stake_witness /= ed25519_signature
$stake_witness /= $ed25519_signature
; Witness for a stake key credential, not tagged for backward compatibility
$ed25519_signature /= bytes .size 64
Loading

0 comments on commit 9397ed9

Please sign in to comment.