iroha icon indicating copy to clipboard operation
iroha copied to clipboard

Bitmap repr field in schema

Open mversic opened this issue 9 months ago • 1 comments

  "AccountEventSet": {
    "Bitmap": {
      "repr": "u32",

I don't think that unsigned vs signed conveys meaningful information for a bitmap, rather it should be "repr": 32

mversic avatar Apr 29 '24 07:04 mversic

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

DCNick3 avatar May 14 '24 16:05 DCNick3