Closed Ryun1 closed 10 months ago
It is not cbor map key. It is number of our internal enum. See CertificateKind
enum to match types from kind()
function. Also as there is possibility to serialize StakeRegistration
and StakeDeregistration
with coin and without coin these types have two constructors new
and new_with_coin
depends on it these types serialize into different certs according to CDDL.
Understood - thank you @lisicky 🙏
If you wanna to check a cbor map key of certificate you can serialize a certificate into cbor in look into cbor by third party tool. Like https://cardananium.github.io/cquisitor/ (made by me) or https://cbor.nemo157.com
Using Conway Alpha Build: @emurgo/cardano-serialization-lib-nodejs@12.0.0-alpha.4.
Describe the bug
.kind()
call on new Conway certificates I get incorrect indexes, when comparing to the Conway CDDL schema..kind()
on older certificates the correct value is returned..kind()
is meant to do?Expected behaviour
Old Certificates (working):
console.log(CSL.Certificate.new_stake_registration(CSL.StakeRegistration.new(randomCredential)).kind());
0
is expected and0
is returned.console.log(CSL.Certificate.new_stake_deregistration(CSL.StakeDeregistration.new(randomCredential)).kind());
1
is expected and1
is returned.console.log(CSL.Certificate.new_stake_delegation(CSL.StakeDelegation.new(randomCredential, randomKeyHash)).kind());
2
is expected and2
is returned.New Certificates (not working):
console.log(CSL.Certificate.new_vote_delegation(CSL.VoteDelegation.new(randomCredential, randomDRep)).kind());
9
is expected (see CDDL), but15
is returned.console.log(CSL.Certificate.new_drep_registration(dRepRegCert).kind());
16
is expected (see CDDL), but10
is returned.console.log(CSL.Certificate.new_drep_deregistration(dRepDeRegCert).kind());
17
is expected (see CDDL), but9
is returned.(sorry I did not have time to test every new cert🙏)