bitshares / bitshares-core

BitShares Blockchain node and command-line wallet
https://bitshares.github.io/
Other
1.17k stars 649 forks source link

Extend get_block_header API and get_block_header_batch API to optionally return witness signatures #2652

Closed abitmore closed 2 years ago

abitmore commented 2 years ago

Follow-up of #2641, for issue #2588.

Instead of always returning witness signatures (as in #2641), this PR adds an optional with_witness_signature parameter to the get_block_header API, and add an optional with_witness_signatures parameter to the get_block_header_batch API, to indicate whether to return witness signatures.

This PR also updates the return types of these 2 APIs so that witness signature can optionally be returned. The new type maybe_signed_block_header is derived from block_header with an optional witness_signature field.

   struct maybe_signed_block_header : block_header
   {
      optional<signature_type> witness_signature;
   };

Updated APIs:

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

86.7% 86.7% Coverage
0.0% 0.0% Duplication