/// Returns the representation-independent hash.
// TODO(EXC-235): Avoid the duplication between this method and the one in
// `UserQuery`.
Returns the representation-independent hash.
TODO(EXC-235): Avoid the duplication between this method and the one in
`UserQuery`.
Returns the representation - independent hash . TODO ( EXC - 235 ) : Avoid the duplication between this method and the one in ` UserQuery ` .
pub fn representation_independent_hash(&self) -> [u8; 32] {
        use RawHttpRequestVal::*;
        let mut map = btreemap! {
            "request_type".to_string() => String("query".to_string()),
            "canister_id".to_string() => Bytes(self.canister_id.0.clone()),
            "method_name".to_string() => String(self.method_name.clone()),
            "arg".to_string() => Bytes(self.arg.0.clone()),
            "ingress_expiry".to_string() => U64(self.ingress_expiry),
            "sender".to_string() => Bytes(self.sender.0.clone()),
        };
        if let Some(nonce) = &self.nonce {
            map.insert("nonce".to_string(), Bytes(nonce.0.clone()));
        }
        hash_of_map(&map)
    }
pub fn representation_independent_hash ( & self ) -> [ u8 ; 32 ] { use RawHttpRequestVal :: * ; let mut map = btreemap ! { " " to_string ( ) String ( " " to_string ( ) ) " " to_string ( ) Bytes ( self canister_id 0 clone ( ) ) " " to_string ( ) String ( self method_name clone ( ) ) " " to_string ( ) Bytes ( self arg 0 clone ( ) ) " " to_string ( ) U64 ( self ingress_expiry ) " " to_string ( ) Bytes ( self sender 0 clone ( ) ) } ; if let Some ( nonce ) = & self . nonce { map . insert ( " " . to_string ( ) , Bytes ( nonce . 0 . clone ( ) ) ) ; } hash_of_map ( & map ) }
Returns the representation-independent hash.
Returns the representation - independent hash .
&self