systeminit / si

The System Initiative software
https://systeminit.com
Apache License 2.0
955 stars 67 forks source link

Correct node_hash calculation for InputSocketNodeWeight and SchemaVariantNodeWeight #4613

Closed jhelwig closed 3 days ago

jhelwig commented 3 days ago

Turns out that self.content_address.to_string() is just the name of the enum variant (SchemaVariant, InputSocket, etc.) and doesn't actually include any of the hash itself.

The uses of self.content_address inside of serde_json::json![...] are technically fine, since serde_json will basically output a form of the debug output of the enum, but it's such an easy thing to forget that serde_json has special handling that it felt like we should avoid using it directly for the node_hash in general.