cml_chain_wasm/governance/
utils.rs1use wasm_bindgen::prelude::wasm_bindgen;
2
3use cml_crypto_wasm::{Ed25519KeyHash, ScriptHash};
4
5use super::{GovAction, Voter};
6
7#[wasm_bindgen]
8impl GovAction {
9 pub fn script_hash(&self) -> Option<ScriptHash> {
10 self.0.script_hash().map(|hash| (*hash).into())
11 }
12}
13
14#[wasm_bindgen]
15impl Voter {
16 pub fn key_hash(&self) -> Option<Ed25519KeyHash> {
17 self.0.key_hash().map(|hash| (*hash).into())
18 }
19
20 pub fn script_hash(&self) -> Option<ScriptHash> {
21 self.0.script_hash().map(|hash| (*hash).into())
22 }
23}