Просмотр исходного кода

dao: s/get_current_slot/get_verifying_slot/

zero 2 лет назад
Родитель
Сommit
7e6a60bfc0

+ 2 - 2
src/contract/dao/src/entrypoint/propose.rs

@@ -26,7 +26,7 @@ use darkfi_sdk::{
     error::{ContractError, ContractResult},
     msg,
     pasta::pallas,
-    util::get_current_slot,
+    util::get_verifying_slot,
     ContractCall,
 };
 use darkfi_serial::{deserialize, serialize, Encodable, WriteExt};
@@ -81,7 +81,7 @@ pub(crate) fn dao_propose_get_metadata(
         ));
     }
 
-    let current_day = slot_to_day(get_current_slot());
+    let current_day = slot_to_day(get_verifying_slot());
 
     let total_funds_coords = total_funds_commit.to_affine().coordinates().unwrap();
     zk_public_inputs.push((

+ 2 - 2
src/contract/dao/src/entrypoint/vote.rs

@@ -24,7 +24,7 @@ use darkfi_sdk::{
     error::{ContractError, ContractResult},
     msg,
     pasta::pallas,
-    util::get_current_slot,
+    util::get_verifying_slot,
     ContractCall,
 };
 use darkfi_serial::{deserialize, serialize, Encodable, WriteExt};
@@ -85,7 +85,7 @@ pub(crate) fn dao_vote_get_metadata(
         ));
     }
 
-    let current_day = slot_to_day(get_current_slot());
+    let current_day = slot_to_day(get_verifying_slot());
 
     let yes_vote_commit_coords = params.yes_vote_commit.to_affine().coordinates().unwrap();
     let all_vote_commit_coords = all_vote_commit.to_affine().coordinates().unwrap();

+ 1 - 1
src/contract/test-harness/src/dao_propose.rs

@@ -98,7 +98,7 @@ impl TestHarness {
             },
         ];
 
-        let creation_day = slot_to_day(wallet.validator.consensus.time_keeper.current_slot());
+        let creation_day = slot_to_day(wallet.validator.consensus.time_keeper.verifying_slot);
         let proposal = DaoProposal {
             auth_calls,
             creation_day,

+ 1 - 1
src/contract/test-harness/src/dao_vote.rs

@@ -79,7 +79,7 @@ impl TestHarness {
             signature_secret,
         };
 
-        let current_day = slot_to_day(wallet.validator.consensus.time_keeper.current_slot());
+        let current_day = slot_to_day(wallet.validator.consensus.time_keeper.verifying_slot);
         let call = DaoVoteCall {
             inputs: vec![input],
             vote_option,