|
|
@@ -27,7 +27,8 @@ use darkfi_sdk::{
|
|
|
error::{ContractError, ContractResult},
|
|
|
msg,
|
|
|
pasta::pallas,
|
|
|
- util::get_verifying_block_height,
|
|
|
+ tx::TransactionHash,
|
|
|
+ util::{get_tx_location, get_verifying_block_height},
|
|
|
ContractCall,
|
|
|
};
|
|
|
use darkfi_serial::{deserialize, serialize, Encodable, WriteExt};
|
|
|
@@ -147,10 +148,12 @@ pub(crate) fn dao_propose_process_instruction(
|
|
|
}
|
|
|
|
|
|
assert_eq!(coin_root_data.len(), 32 + 2);
|
|
|
- let tx_hash = &coin_root_data[0..32];
|
|
|
+ let tx_hash_data: [u8; 32] = coin_root_data[0..32].try_into().unwrap();
|
|
|
+ let tx_hash = TransactionHash(tx_hash_data);
|
|
|
// Get block_height where tx_hash was confirmed
|
|
|
- let tx_height = get_verifying_block_height() as u32;
|
|
|
- let current_height = get_verifying_block_height() as u32;
|
|
|
+ //let (tx_height, _) = get_tx_location(&tx_hash)?;
|
|
|
+ let tx_height = 0;
|
|
|
+ let current_height = get_verifying_block_height();
|
|
|
if current_height - tx_height > PROPOSAL_SNAPSHOT_CUTOFF_LIMIT {
|
|
|
msg!("[Dao::Propose] Error: Snapshot is too old. Current height: {}, snapshot height: {}",
|
|
|
current_height, tx_height);
|