iroha
iroha copied to clipboard
Bitmap repr field in schema
"AccountEventSet": {
"Bitmap": {
"repr": "u32",
I don't think that unsigned vs signed conveys meaningful information for a bitmap, rather it should be "repr": 32
Currently the repr just corresponds to the underlying rust type used, as it was just simpler to implement.
The design is also somewhat loosely based on bitflags crate, although there the signedness actually does matter, for generated methods like bits()
.
In the end, I agree that this is better represented by the amount of bits in the mask; if downstream users of the schema haven't started relying on this (SDKs, iroha2 docs, something else?). I've implemented support in docs (https://github.com/hyperledger/iroha-2-docs/pull/485/commits/f1ab8d46a95b359cdde6be4a0af45d1e897a8731), though that is still pretty easy to update