Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion helper for genesis_hash to network type #212

Open
DOBEN opened this issue Sep 4, 2024 · 0 comments
Open

Conversion helper for genesis_hash to network type #212

DOBEN opened this issue Sep 4, 2024 · 0 comments
Labels
[Type] Task An additional feature or improvement.

Comments

@DOBEN
Copy link
Member

DOBEN commented Sep 4, 2024

Task description

Prerequisite:
#209

Currently, the get_consensus_info() function returns the genesis hash. For ZK proof verification we need to convert the genesis hash into the type Network::Testnet/Network::Mainnet.

The manual conversion is awkward:
https://github.com/Concordium/concordium-dapp-examples/blob/e34d1a55e92bb912695147f9561afe4af6af2620/compliant-reward-distribution/indexer-and-server/src/bin/server.rs#L142C5-L153C1

Suggestion to add a conversion helper function:

let network: Option<Network> = GENESIS_BLOCK_HASH.convert();
fn convert() -> Option<Network>
   {
      ...
   }
@DOBEN DOBEN added the [Type] Task An additional feature or improvement. label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Task An additional feature or improvement.
Projects
None yet
Development

No branches or pull requests

1 participant