Преглед изворни кода

validator/utils: Add FIXME note about dangerous code

parazyd пре 2 година
родитељ
комит
6002324810
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      src/validator/utils.rs

+ 2 - 2
src/validator/utils.rs

@@ -119,10 +119,10 @@ pub async fn block_rank(block: &BlockInfo, previous_previous: &BlockInfo) -> Res
     let data = &tx.calls[0].data.data;
     let data = &tx.calls[0].data.data;
     let mut decoder = Cursor::new(&data);
     let mut decoder = Cursor::new(&data);
     // PoW uses MoneyPoWRewardParamsV1
     // PoW uses MoneyPoWRewardParamsV1
-    decoder.set_position(499);
-    let vrf_proof: VrfProof = AsyncDecodable::decode_async(&mut decoder).await?;
+    decoder.set_position(499); // FIXME: This should not be done like this
 
 
     // Get the VRF output as big-endian
     // Get the VRF output as big-endian
+    let vrf_proof: VrfProof = AsyncDecodable::decode_async(&mut decoder).await?;
     let vrf_output = BigUint::from_bytes_be(vrf_proof.hash_output().as_bytes());
     let vrf_output = BigUint::from_bytes_be(vrf_proof.hash_output().as_bytes());
 
 
     // Finally, compute the rank
     // Finally, compute the rank