Skip to main content

BenchmarksExt

Trait BenchmarksExt 

Source
pub trait BenchmarksExt {
    // Required methods
    fn benchmarks_blake3_hash_chunk(
        &self,
        contract: Address,
        chunk: &[u8; 1024],
    ) -> Result<[u8; 32], ContractError>;
    fn benchmarks_ed25519_verify(
        &self,
        contract: Address,
        public_key: &Ed25519PublicKey,
        signature: &Ed25519Signature,
        message: &[u8; 32],
    ) -> Result<Bool, ContractError>;
}
Expand description

Extension trait that provides helper methods for calling Benchmarks’s methods on Env for convenience purposes

Required Methods§

Source

fn benchmarks_blake3_hash_chunk( &self, contract: Address, chunk: &[u8; 1024], ) -> Result<[u8; 32], ContractError>

Hash a single chunk worth of bytes

Source

fn benchmarks_ed25519_verify( &self, contract: Address, public_key: &Ed25519PublicKey, signature: &Ed25519Signature, message: &[u8; 32], ) -> Result<Bool, ContractError>

Verify a single Ed25519 signature

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl BenchmarksExt for Env<'_>

Source§

fn benchmarks_blake3_hash_chunk( &self, contract: Address, chunk: &[u8; 1024], ) -> Result<[u8; 32], ContractError>

Source§

fn benchmarks_ed25519_verify( &self, contract: Address, public_key: &Ed25519PublicKey, signature: &Ed25519Signature, message: &[u8; 32], ) -> Result<Bool, ContractError>

Implementors§