stellar / slingshot

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

blockchain: safe initializer for ShortIDVec #436

Closed oleganza closed 4 years ago

oleganza commented 4 years ago

Currently ShortIDVec can be initialized with unaligned vector (not divisible by 6), which is not immediately problematic, but may cause problems down the road. Should make inner field private and add ::new()->Option<Self> that checks the length and rejects badly sized inputs.