mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
validator: fixed minor encoding/decoding bugs
This commit is contained in:
@@ -311,7 +311,7 @@ pub(crate) fn get_last_block_info(mut ctx: FunctionEnvMut<Env>) -> i64 {
|
||||
|
||||
// Create the return object
|
||||
let mut ret = Vec::with_capacity(8 + 32 + blake3::OUT_LEN);
|
||||
ret.extend_from_slice(&block.header.height.to_be_bytes());
|
||||
ret.extend_from_slice(&darkfi_serial::serialize(&block.header.height));
|
||||
ret.extend_from_slice(&block.header.nonce.to_repr());
|
||||
ret.extend_from_slice(block.header.previous.as_bytes());
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ pub async fn block_rank(block: &BlockInfo, previous_previous: &BlockInfo) -> Res
|
||||
let data = &tx.calls[0].data.data;
|
||||
let mut decoder = Cursor::new(&data);
|
||||
// PoW uses MoneyPoWRewardParamsV1
|
||||
decoder.set_position(563);
|
||||
decoder.set_position(499);
|
||||
let vrf_proof: VrfProof = AsyncDecodable::decode_async(&mut decoder).await?;
|
||||
|
||||
// Compute VRF u64
|
||||
|
||||
Reference in New Issue
Block a user