pub fn total_supply(&self, maybe_post_state: Option<Digest>) -> U512 {
        let mint_key: Key = self
            .mint_contract_hash
            .expect("should have mint_contract_hash")
            .into();

        let result = self.query(maybe_post_state, mint_key, &[TOTAL_SUPPLY_KEY.to_string()]);

        let total_supply: U512 = if let Ok(StoredValue::CLValue(total_supply)) = result {
            total_supply.into_t().expect("total supply should be U512")
        } else {
            panic!("mint should track total supply");
        };

        total_supply
    }
/// Queries for the total supply of token.
/// # Panics
/// Panics if the total supply can't be found.
Queries for the total supply of token.
Queries for the total supply of token .
pub fn total_supply(&self, maybe_post_state: Option<Digest>) -> U512 {
        let mint_key: Key = self
            .mint_contract_hash
            .expect("should have mint_contract_hash")
            .into();
        let result = self.query(maybe_post_state, mint_key, &[TOTAL_SUPPLY_KEY.to_string()]);
        let total_supply: U512 = if let Ok(StoredValue::CLValue(total_supply)) = result {
            total_supply.into_t().expect("total supply should be U512")
        } else {
            panic!("mint should track total supply");
        };
        total_supply
    }
pub fn total_supply ( & self , maybe_post_state : Option < Digest > ) -> U512 { let mint_key : Key = self . mint_contract_hash . expect ( " " ) . into ( ) ; let result = self . query ( maybe_post_state , mint_key , & [ TOTAL_SUPPLY_KEY . to_string ( ) ] ) ; let total_supply : U512 = if let Ok ( StoredValue :: CLValue ( total_supply ) ) = result { total_supply . into_t ( ) . expect ( " " ) } else { panic ! ( " " ) ; } ; total_supply }
Queries for the total supply of token.
Queries for the total supply of token .
&self
maybe_post_state
Option<Digest>
&self
maybe_post_state
Option<Digest>
panics
Panics if the total supply can't be found.
Panics if the total supply can ' t be found .