Skip to content

Proto/Michelson: add a variant of VOTING_POWER taking address as input

What

This MR adds a variant of the VOTING_POWER instruction which takes as input a value of type address (instead of key_hash).

Why

The main use case for the VOTING_POWER instruction is to run on-chain votes and polls where bakers can vote in proportion to their stake. In particular, the Etherlink governance contracts of MR !12282 (merged) use VOTING_POWER for this. Unfortunately, sender-based authentication (using either SOURCE or SENDER) for such contracts provide a value of type address which cannot simply be converted to the key_hash required by VOTING_POWER.

Related MRs: !12436, !12440.

How

Implementation is straightforward.

Manually testing the MR

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Raphaël Cauderlier

Merge request reports