mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
daod bugfix, use ** for deref any since the any is &
This commit is contained in:
@@ -35,6 +35,10 @@ use darkfi::{
|
||||
zk::circuit::{BurnContract, MintContract},
|
||||
};
|
||||
|
||||
fn type_of<T>(_: &T) -> &'static str {
|
||||
std::any::type_name::<T>()
|
||||
}
|
||||
|
||||
/// The state machine, held in memory.
|
||||
struct MemoryState {
|
||||
/// The entire Merkle tree state
|
||||
@@ -184,6 +188,7 @@ mod dao_contract {
|
||||
/// ```
|
||||
pub mod mint {
|
||||
use darkfi::crypto::keypair::PublicKey;
|
||||
use log::debug;
|
||||
use pasta_curves::pallas;
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
@@ -243,7 +248,7 @@ mod dao_contract {
|
||||
let func_call = &parent_tx.func_calls[func_call_index];
|
||||
let call_data = &func_call.call_data;
|
||||
|
||||
assert_eq!((&*call_data).type_id(), TypeId::of::<CallData>());
|
||||
assert_eq!((&**call_data).type_id(), TypeId::of::<CallData>());
|
||||
let func_call = func_call.call_data.downcast_ref::<CallData>();
|
||||
Ok(Update {})
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ mod dao_contract {
|
||||
// So we know the tx is well formed.
|
||||
|
||||
// we can elide this with macro magic
|
||||
assert_eq((&*call_data).type_id(), TypeId::of::<CallData>());
|
||||
assert_eq((&**call_data).type_id(), TypeId::of::<CallData>());
|
||||
let func_call = func_call.call_data.downcast_ref::<CallData>();
|
||||
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user