Skip to content

Draft: Add `HiveStringInt` and `HiveStringUint` types

Michał Kudela requested to merge kudmich/add-hive_string_int-type into master

New types HiveStringInt (instead of Int64) and HiveStringUint (instead of Uint64) have been created because in some operations values ​​are written as int and above 2^53 - 1, (i.e. 9007199254740991) are written as int in string - to prevent loss of precision.

Operations affected by this problem:

  • pow,
  • pow2,
  • remove_proposal_operation,
  • update_proposal_operation,
  • update_proposal_votes_operation,
  • effective_comment_vote_operation.
  1. Example ("nonce" as int-in-string): https://testexplore.openhive.network/block/999890?filters=00004000_h
        {
          "type": "pow_operation",
          "value": {
            "work": {
              "work": "0000000c082f2ee7de8fbec24de6db7b593a78656fa0611f41678f27a6827d95",
              "input": "39b17f4f8af3ee25856b846078d58d992a7ca9a4d74ab916c2bd3b9aea4d8bf5",
              "worker": "STM6ChCh8ryiuwfbzFfViZvh6t6gAZzSg8BubWQbqUBviHCSefFkd",
              "signature": "20b53e856685b8c247e6409d9aef3ade100f9507f304b467616297123db4a693bf15e14c44977732052ecec548bb496d0eca450540191722414169323fbb8dd702"
            },
            "nonce": "18170171114775343590",
            "props": {
              "hbd_interest_rate": 1000,
              "maximum_block_size": 131072,
              "account_creation_fee": {
                "nai": "@@000000021",
                "amount": "1",
                "precision": 3
              }
            },
            "block_id": "000f41d13953e256b5377d0aec0574857051e836",
            "worker_account": "hr702"
          }
        }

Example 2 ("proposal_ids" as int): https://testexplore.openhive.network/block/92887185?filters=00000000-00002000_h

{
          "type": "update_proposal_votes_operation",
          "value": {
            "voter": "lilfage",
            "approve": true,
            "extensions": [],
            "proposal_ids": [
              283
            ]
          }
        }
Edited by Michał Kudela

Merge request reports

Loading