We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIRToStakeCredentials
Any transaction that contains a MIR certificate crashes when calling to_json. This may be caused by our good old friend linked_hash_map
to_json
linked_hash_map
Crash log:
Err` value: JsError { msg: "to_json: key must be a string" }
Steps to reproduce
#[test] fn foo_bar() { let mut cred = MIRToStakeCredentials::new(); cred.insert( &StakeCredential::from_keyhash( &Ed25519KeyHash::from_bytes( hex::decode("b861eeadde300385d88aaa98cad0f0ed1f95419bbb9971a0fb7c96fb").unwrap() ).unwrap() ), &Int::from_str("5").unwrap() ); println!("{}", cred.to_json().unwrap()); }
The text was updated successfully, but these errors were encountered:
I believe the root cause is a missing implementation of serde::Serialize for StakeCredential such as
serde::Serialize
StakeCredential
impl serde::Serialize for TransactionMetadatum { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer { let json_str = decode_metadatum_to_json_str(self, MetadataJsonSchema::DetailedSchema) .map_err(|e| serde::ser::Error::custom(&format!("{:?}", e)))?; serializer.serialize_str(&json_str) } }
Note sure why the derived implementation doesn't give us what we want
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Any transaction that contains a MIR certificate crashes when calling
to_json
. This may be caused by our good old friendlinked_hash_map
Crash log:
Steps to reproduce
The text was updated successfully, but these errors were encountered: