Conversation
There was a problem hiding this comment.
since u128 is not implemented for PrimaryKey I was not able to.
Not sure if u128 is intentionally not implemented here
Yes it was. #547 (comment)
The real question is - do you really need 128 bit key?
@maurolacy ?
|
I building an optimized version of Claim and a sorted index that will save a sorted list of a defined number of claims. To achieve the sorted claim list, I am indexing the total claim amount with the address as appended key, bool is just a placeholder. |
|
Looks like doubling the size of every key will be very costly for this feature... |
Yes. We can add this, but better to avoid it. My question would be, why you can't use Converting the key to a string would work too. Or using a tuple of two |
There was a problem hiding this comment.
On second thought, I think this wouldn't hurt, as those bytes are in memory / stack in the first place, and do not hit storage.
Approving. Will create a follow-up issue to benchmark Key performance with and without u128 support, so we confirm this.
Update: See #695.
I needed to implement a
(Uint128, &Addr)composite keymap, since u128 is not implemented forPrimaryKeyI was not able to.Not sure if u128 is intentionally not implemented here, just pushing it here in case it is left over