stellar / slingshot

A new blockchain architecture under active development, with a strong focus on scalability, privacy and safety
Apache License 2.0
415 stars 61 forks source link

readerwriter: move Encodable::encoded_length into new trait #437

Closed p0lunin closed 4 years ago

p0lunin commented 4 years ago

Now we have an Encodable trait with two methods: encode and encoded_length. But in almost cases we don't need to have encoded_length. It is used in some places in zkvm. Solution is to create new trait KnownLength, which has method encoded_length, and implement this trait for those structures which really need to have this method.