Question about the amplify library #72
-
Hi there, I found a lot of amplify related functions used in rgb lib source code, so I want to ask why is amplify chosen here, any advantages or disadvantages? Can we just use hashmap or hashset instead of tinyordmap and so on? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Rationale: 1, I am the author and maintainer of |
Beta Was this translation helpful? Give feedback.
Rationale:
1, I am the author and maintainer of
amplify
crates. I wrote them specifically to avoid external dependencies for the consensus-critical code as much as possible.2.
TinyOrdMap
you are mentioning is an example of so-called confined collections from by the amplify crate. Their purpose is to provide compile-time guarantees on the collection size (upper and lower bounds).3. thus no, we can't "just use" hashmap or hashset since we will lose these guarantees.