Closed dankelleher closed 2 years ago
Thanks very much @joncinque ! Here's a follow-up PR to address your comments. https://github.com/solana-labs/governance-program-library/pull/63 . enum_dispatch is cool.
I just have one concern about the use of copied() here.
It is needed to extract the Option<&Pubkey> into an Option
I just have one concern about the use of copied() here. It is needed to extract the Option<&Pubkey> into an Option. Is there a better way of doing this?
Not that I can think of, the tiniest nit is that you could maybe use cloned
to make it a bit clearer, and in case Pubkey
no longer implements Copy
in the future. Either way, you have to copy from the remaining_account
and into the struct.
This PR brings composability (the ability to chain plugins) to the Civic Gateway plugin.
Specifically, the plugin registrar now accepts a "predecessor" plugin program id. If set, the plugin "inherits" the voter weight from the predecessor plugin. If not set, the plugin inherits the weight from the deposited governance tokens.
Note, the latter requires a slight change in core spl-gov to allow deposits when using a plugin (this is currently disabled). Until this change is made, this PR includes a built .so artifact of spl-governance that enables this (spl_governance_allow_deposits.so).