use super::*;
#[wasm_bindgen]
impl VerifyingKey {
#[wasm_bindgen(js_name = "bondPublicVerifier")]
pub fn bond_public_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::BondPublicVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "claimUnbondPublicVerifier")]
pub fn claim_unbond_public_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::ClaimUnbondPublicVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "feePrivateVerifier")]
pub fn fee_private_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::FeePrivateVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "feePublicVerifier")]
pub fn fee_public_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::FeePublicVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "inclusionVerifier")]
pub fn inclusion_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::InclusionVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "joinVerifier")]
pub fn join_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::JoinVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "setValidatorStateVerifier")]
pub fn set_validator_state_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::SetValidatorStateVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "splitVerifier")]
pub fn split_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::SplitVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "transferPrivateVerifier")]
pub fn transfer_private_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::TransferPrivateVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "transferPrivateToPublicVerifier")]
pub fn transfer_private_to_public_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::TransferPrivateToPublicVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "transferPublicVerifier")]
pub fn transfer_public_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::TransferPublicVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "transferPublicToPrivateVerifier")]
pub fn transfer_public_to_private_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::TransferPublicToPrivateVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "unbondDelegatorAsValidatorVerifier")]
pub fn unbond_delegator_as_validator_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(
&snarkvm_parameters::testnet3::UnbondDelegatorAsValidatorVerifier::load_bytes().unwrap(),
)
.unwrap()
}
#[wasm_bindgen(js_name = "unbondPublicVerifier")]
pub fn unbond_public_verifier() -> VerifyingKey {
VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::UnbondPublicVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "isBondPublicVerifier")]
pub fn is_bond_public_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::BondPublicVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "isClaimUnbondPublicVerifier")]
pub fn is_claim_unbond_public_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(
&snarkvm_parameters::testnet3::ClaimUnbondPublicVerifier::load_bytes().unwrap(),
)
.unwrap()
}
#[wasm_bindgen(js_name = "isFeePrivateVerifier")]
pub fn is_fee_private_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::FeePrivateVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "isFeePublicVerifier")]
pub fn is_fee_public_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::FeePublicVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "isInclusionVerifier")]
pub fn is_inclusion_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::InclusionVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "isJoinVerifier")]
pub fn is_join_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::JoinVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "isSetValidatorStateVerifier")]
pub fn is_set_validator_state_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(
&snarkvm_parameters::testnet3::SetValidatorStateVerifier::load_bytes().unwrap(),
)
.unwrap()
}
#[wasm_bindgen(js_name = "isSplitVerifier")]
pub fn is_split_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::SplitVerifier::load_bytes().unwrap()).unwrap()
}
#[wasm_bindgen(js_name = "isTransferPrivateVerifier")]
pub fn is_transfer_private_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::TransferPrivateVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "isTransferPrivateToPublicVerifier")]
pub fn is_transfer_private_to_public_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(
&snarkvm_parameters::testnet3::TransferPrivateToPublicVerifier::load_bytes().unwrap(),
)
.unwrap()
}
#[wasm_bindgen(js_name = "isTransferPublicVerifier")]
pub fn is_transfer_public_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::TransferPublicVerifier::load_bytes().unwrap())
.unwrap()
}
#[wasm_bindgen(js_name = "isTransferPublicToPrivateVerifier")]
pub fn is_transfer_public_to_private_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(
&snarkvm_parameters::testnet3::TransferPublicToPrivateVerifier::load_bytes().unwrap(),
)
.unwrap()
}
#[wasm_bindgen(js_name = "isUnbondDelegatorAsValidatorVerifier")]
pub fn is_unbond_delegator_as_validator_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(
&snarkvm_parameters::testnet3::UnbondDelegatorAsValidatorVerifier::load_bytes().unwrap(),
)
.unwrap()
}
#[wasm_bindgen(js_name = "isUnbondPublicVerifier")]
pub fn is_unbond_public_verifier(&self) -> bool {
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::UnbondPublicVerifier::load_bytes().unwrap())
.unwrap()
}
}
#[cfg(test)]
mod tests {
use super::*;
use wasm_bindgen_test::*;
#[wasm_bindgen_test]
fn test_key_loading() {
let bond_public = VerifyingKey::bond_public_verifier();
assert!(bond_public.is_bond_public_verifier());
let claim_unbond_public = VerifyingKey::claim_unbond_public_verifier();
assert!(claim_unbond_public.is_claim_unbond_public_verifier());
let fee_private = VerifyingKey::fee_private_verifier();
assert!(fee_private.is_fee_private_verifier());
let fee_public = VerifyingKey::fee_public_verifier();
assert!(fee_public.is_fee_public_verifier());
let inclusion = VerifyingKey::inclusion_verifier();
assert!(inclusion.is_inclusion_verifier());
let join = VerifyingKey::join_verifier();
assert!(join.is_join_verifier());
let set_validator_state = VerifyingKey::set_validator_state_verifier();
assert!(set_validator_state.is_set_validator_state_verifier());
let split = VerifyingKey::split_verifier();
assert!(split.is_split_verifier());
let transfer_private = VerifyingKey::transfer_private_verifier();
assert!(transfer_private.is_transfer_private_verifier());
let transfer_private_to_public = VerifyingKey::transfer_private_to_public_verifier();
assert!(transfer_private_to_public.is_transfer_private_to_public_verifier());
let transfer_public = VerifyingKey::transfer_public_verifier();
assert!(transfer_public.is_transfer_public_verifier());
let transfer_public_to_private = VerifyingKey::transfer_public_to_private_verifier();
assert!(transfer_public_to_private.is_transfer_public_to_private_verifier());
let unbond_delegator_as_validator = VerifyingKey::unbond_delegator_as_validator_verifier();
assert!(unbond_delegator_as_validator.is_unbond_delegator_as_validator_verifier());
let unbond_public = VerifyingKey::unbond_public_verifier();
assert!(unbond_public.is_unbond_public_verifier());
}
}