diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index 06c394730..d5a6df062 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -11,13 +11,12 @@ multiversx_sc::imports!(); /// /// Voting is done through energy. /// -/// The module provides the following configurable parameters: +/// The module provides the following configurable parameters: /// - `minEnergyForPropose` - the minimum energy required for submitting a proposal -/// - `quorum` - the minimum number of (`votes` minus `downvotes`) at the end of voting period -/// - `maxActionsPerProposal` - Maximum number of actions (transfers and/or smart contract calls) that a proposal may have -/// - `votingDelayInBlocks` - Number of blocks to wait after a block is proposed before being able to vote/downvote that proposal -/// - `votingPeriodInBlocks` - Number of blocks the voting period lasts (voting delay does not count towards this) -/// - `lockTimeAfterVotingEndsInBlocks` - Number of blocks to wait before a successful proposal can be executed +/// - `quorum` - the minimum number of (`votes` minus `downvotes`) at the end of voting period +/// - `maxActionsPerProposal` - Maximum number of actions (transfers and/or smart contract calls) that a proposal may have +/// - `votingDelayInSeconds` - Number of seconds to wait after a proposal is created before being able to vote/downvote that proposal +/// - `votingPeriodInSeconds` - Number of seconds the voting period lasts (voting delay does not count towards this) /// /// The module also provides events for most actions that happen: /// - `proposalCreated` - triggers when a proposal is created. Also provoides all the relevant information, like proposer, actions etc. @@ -28,10 +27,10 @@ multiversx_sc::imports!(); /// /// Please note that although the main contract can modify the module's storage directly, it is not recommended to do so, /// as that defeats the whole purpose of having governance. These parameters should only be modified through actions. -const MIN_VOTING_DELAY: u64 = 1; -const MAX_VOTING_DELAY: u64 = 100_800; // 1 Week -const MIN_VOTING_PERIOD: u64 = 14_400; // 24 Hours -const MAX_VOTING_PERIOD: u64 = 201_600; // 2 Weeks +const MIN_VOTING_DELAY: DurationSeconds = DurationSeconds::new(1); +const MAX_VOTING_DELAY: DurationSeconds = DurationSeconds::new(100_800); +const MIN_VOTING_PERIOD: DurationSeconds = DurationSeconds::new(14_400); +const MAX_VOTING_PERIOD: DurationSeconds = DurationSeconds::new(201_600); const MIN_QUORUM: u64 = 1_000; // 10% const MAX_QUORUM: u64 = 6_000; // 60% const MIN_MIN_FEE_FOR_PROPOSE: u64 = 2_000_000; @@ -72,15 +71,15 @@ pub trait ConfigurablePropertiesModule: } #[only_owner] - #[endpoint(changeVotingDelayInBlocks)] - fn change_voting_delay_in_blocks(&self, new_value: u64) { - self.try_change_voting_delay_in_blocks(new_value); + #[endpoint(changeVotingDelayInSeconds)] + fn change_voting_delay_in_seconds(&self, new_value: DurationSeconds) { + self.try_change_voting_delay_in_seconds(&new_value); } #[only_owner] - #[endpoint(changeVotingPeriodInBlocks)] - fn change_voting_period_in_blocks(&self, new_value: u64) { - self.try_change_voting_period_in_blocks(new_value); + #[endpoint(changeVotingPeriodInSeconds)] + fn change_voting_period_in_seconds(&self, new_value: DurationSeconds) { + self.try_change_voting_period_in_seconds(&new_value); } fn try_change_min_energy_for_propose(&self, new_value: BigUint) { @@ -109,22 +108,22 @@ pub trait ConfigurablePropertiesModule: self.quorum_percentage().set(new_quorum_percentage); } - fn try_change_voting_delay_in_blocks(&self, new_voting_delay: u64) { + fn try_change_voting_delay_in_seconds(&self, new_voting_delay: &DurationSeconds) { require!( - (MIN_VOTING_DELAY..MAX_VOTING_DELAY).contains(&new_voting_delay), + (MIN_VOTING_DELAY..MAX_VOTING_DELAY).contains(new_voting_delay), "Not valid value for voting delay!" ); - self.voting_delay_in_blocks().set(new_voting_delay); + self.voting_delay_in_seconds().set(new_voting_delay); } - fn try_change_voting_period_in_blocks(&self, new_voting_period: u64) { + fn try_change_voting_period_in_seconds(&self, new_voting_period: &DurationSeconds) { require!( - (MIN_VOTING_PERIOD..MAX_VOTING_PERIOD).contains(&new_voting_period), + (MIN_VOTING_PERIOD..MAX_VOTING_PERIOD).contains(new_voting_period), "Not valid value for voting period!" ); - self.voting_period_in_blocks().set(new_voting_period); + self.voting_period_in_seconds().set(new_voting_period); } fn try_change_withdraw_percentage_defeated(&self, new_withdraw_percentage: u64) { @@ -158,13 +157,13 @@ pub trait ConfigurablePropertiesModule: #[storage_mapper("quorumPercentage")] fn quorum_percentage(&self) -> SingleValueMapper; - #[view(getVotingDelayInBlocks)] - #[storage_mapper("votingDelayInBlocks")] - fn voting_delay_in_blocks(&self) -> SingleValueMapper; + #[view(getVotingDelayInSeconds)] + #[storage_mapper("votingDelayInSeconds")] + fn voting_delay_in_seconds(&self) -> SingleValueMapper; - #[view(getVotingPeriodInBlocks)] - #[storage_mapper("votingPeriodInBlocks")] - fn voting_period_in_blocks(&self) -> SingleValueMapper; + #[view(getVotingPeriodInSeconds)] + #[storage_mapper("votingPeriodInSeconds")] + fn voting_period_in_seconds(&self) -> SingleValueMapper; #[view(getFeeTokenId)] #[storage_mapper("feeTokenId")] diff --git a/energy-integration/governance-v2/src/events.rs b/energy-integration/governance-v2/src/events.rs index eb736bcc9..b92136a9c 100644 --- a/energy-integration/governance-v2/src/events.rs +++ b/energy-integration/governance-v2/src/events.rs @@ -10,7 +10,7 @@ pub trait EventsModule { &self, #[indexed] proposal_id: usize, #[indexed] proposer: &ManagedAddress, - #[indexed] start_block: u64, + #[indexed] start_timestamp: TimestampSeconds, #[indexed] proposal: &GovernanceProposal, ); diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index c80a88bac..3f7ff18ce 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -30,10 +30,10 @@ pub trait GovernanceV2: { /// - `min_energy_for_propose` - the minimum energy required for submitting a proposal /// - `min_fee_for_propose` - the minimum fee required for submitting a proposal - /// - `quorum_percentage` - the minimum number of (`votes` minus `downvotes`) at the end of voting period - /// - `votingDelayInBlocks` - Number of blocks to wait after a block is proposed before being able to vote/downvote that proposal - /// - `votingPeriodInBlocks` - Number of blocks the voting period lasts (voting delay does not count towards this) - /// - `withdraw_percentage_defeated` - Percetange of the fee to be returned if proposal defetead + /// - `quorum_percentage` - the minimum number of (`votes` minus `downvotes`) at the end of voting period + /// - `voting_delay_in_seconds` - Number of seconds to wait after a proposal is created before being able to vote/downvote that proposal + /// - `voting_period_in_seconds` - Number of seconds the voting period lasts (voting delay does not count towards this) + /// - `withdraw_percentage_defeated` - Percentage of the fee to be returned if proposal defeated /// - `energy_factory_address` /// - `fees_collector_address` /// - `fee_token` - The token used to pay the fee @@ -43,8 +43,8 @@ pub trait GovernanceV2: min_energy_for_propose: BigUint, min_fee_for_propose: BigUint, quorum_percentage: u64, - voting_delay_in_blocks: u64, - voting_period_in_blocks: u64, + voting_delay_in_seconds: DurationSeconds, + voting_period_in_seconds: DurationSeconds, withdraw_percentage_defeated: u64, energy_factory_address: ManagedAddress, fees_collector_address: ManagedAddress, @@ -53,8 +53,8 @@ pub trait GovernanceV2: self.try_change_min_energy_for_propose(min_energy_for_propose); self.try_change_min_fee_for_propose(min_fee_for_propose); self.try_change_quorum_percentage(quorum_percentage); - self.try_change_voting_delay_in_blocks(voting_delay_in_blocks); - self.try_change_voting_period_in_blocks(voting_period_in_blocks); + self.try_change_voting_delay_in_seconds(&voting_delay_in_seconds); + self.try_change_voting_period_in_seconds(&voting_period_in_seconds); self.try_change_withdraw_percentage_defeated(withdraw_percentage_defeated); self.set_energy_factory_address(energy_factory_address); self.fees_collector_address().set(&fees_collector_address); @@ -121,10 +121,10 @@ pub trait GovernanceV2: ); let minimum_quorum = self.quorum_percentage().get(); - let voting_delay_in_blocks = self.voting_delay_in_blocks().get(); - let voting_period_in_blocks = self.voting_period_in_blocks().get(); + let voting_delay_in_seconds = self.voting_delay_in_seconds().get(); + let voting_period_in_seconds = self.voting_period_in_seconds().get(); let withdraw_percentage_defeated = self.withdraw_percentage_defeated().get(); - let current_block = self.blockchain().get_block_nonce(); + let current_timestamp = self.blockchain().get_block_timestamp_seconds(); let proposal = GovernanceProposal { proposal_id: self.proposals().len() + 1, @@ -133,18 +133,18 @@ pub trait GovernanceV2: actions: gov_actions, fee_payment: user_fee, minimum_quorum, - voting_delay_in_blocks, - voting_period_in_blocks, + voting_delay_in_seconds, + voting_period_in_seconds, withdraw_percentage_defeated, total_quorum: BigUint::zero(), - proposal_start_block: current_block, + proposal_start_timestamp: current_timestamp, fee_withdrawn: false, }; let proposal_id = self.proposals().push(&proposal); self.proposal_votes(proposal_id) .set(ProposalVotes::default()); - self.proposal_created_event(proposal_id, &proposer, current_block, &proposal); + self.proposal_created_event(proposal_id, &proposer, current_timestamp, &proposal); proposal_id } diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 4735d088f..3f5677069 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -63,11 +63,11 @@ pub struct GovernanceProposal { pub description: ManagedBuffer, pub fee_payment: EsdtTokenPayment, pub minimum_quorum: u64, - pub voting_delay_in_blocks: u64, - pub voting_period_in_blocks: u64, + pub voting_delay_in_seconds: DurationSeconds, + pub voting_period_in_seconds: DurationSeconds, pub withdraw_percentage_defeated: u64, pub total_quorum: BigUint, - pub proposal_start_block: u64, + pub proposal_start_timestamp: TimestampSeconds, pub fee_withdrawn: bool, } @@ -97,16 +97,16 @@ impl GovernanceProposal { actions: ArrayVec::default(), description: ManagedBuffer::default(), fee_payment: EsdtTokenPayment { - token_identifier: TokenIdentifier::from(""), + token_identifier: TokenIdentifier::from("EGLD-123456"), token_nonce: 0, amount: BigUint::zero(), }, minimum_quorum: 0, - voting_delay_in_blocks: 0, - voting_period_in_blocks: 0, + voting_delay_in_seconds: DurationSeconds::zero(), + voting_period_in_seconds: DurationSeconds::zero(), withdraw_percentage_defeated: 0, total_quorum: BigUint::default(), - proposal_start_block: 0, + proposal_start_timestamp: TimestampSeconds::zero(), fee_withdrawn: false, } } diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index ec748edd9..60319a542 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -18,20 +18,20 @@ pub trait ViewsModule: return GovernanceProposalStatus::None; } - let current_block = self.blockchain().get_block_nonce(); + let current_timestamp = self.blockchain().get_block_timestamp_seconds(); let proposal = self.proposals().get(proposal_id); - let proposal_block = proposal.proposal_start_block; + let proposal_timestamp = proposal.proposal_start_timestamp; - let voting_delay = proposal.voting_delay_in_blocks; - let voting_period = proposal.voting_period_in_blocks; + let voting_delay = proposal.voting_delay_in_seconds; + let voting_period = proposal.voting_period_in_seconds; - let voting_start = proposal_block + voting_delay; + let voting_start = proposal_timestamp + voting_delay; let voting_end = voting_start + voting_period; - if current_block < voting_start { + if current_timestamp < voting_start { return GovernanceProposalStatus::Pending; } - if current_block >= voting_start && current_block < voting_end { + if current_timestamp >= voting_start && current_timestamp < voting_end { return GovernanceProposalStatus::Active; } diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 342655adf..8605d6740 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -43,7 +43,7 @@ fn gov_propose_test() { .up_vote(&second_user_addr, proposal_id) .assert_user_error("Proposal is not active"); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup @@ -55,7 +55,7 @@ fn gov_propose_test() { .up_vote(&second_user_addr, proposal_id) .assert_user_error("Already voted for this proposal"); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -150,7 +150,7 @@ fn gov_no_veto_vote_test() { }) .assert_ok(); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup @@ -162,7 +162,7 @@ fn gov_no_veto_vote_test() { .down_veto_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -198,14 +198,14 @@ fn gov_abstain_vote_test() { result.assert_ok(); assert_eq!(proposal_id, 1); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup .abstain_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -240,11 +240,11 @@ fn gov_no_quorum_test() { result.assert_ok(); assert_eq!(proposal_id, 1); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -279,11 +279,11 @@ fn gov_modify_quorum_after_end_vote_test() { result.assert_ok(); assert_eq!(proposal_id, 1); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -330,14 +330,14 @@ fn gov_withdraw_defeated_proposal_test() { .b_mock .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup .down_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -392,14 +392,14 @@ fn gov_modify_withdraw_defeated_proposal_test() { .b_mock .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup .down_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .change_withdraw_percentage(FULL_PERCENTAGE + 1u64) @@ -463,14 +463,14 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { .b_mock .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup .down_veto_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -527,14 +527,14 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { .b_mock .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup .down_veto_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock @@ -577,14 +577,14 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { .b_mock .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(VOTING_PERIOD_BLOCKS); gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); gov_setup .down_veto_vote(&third_user_addr, proposal_id) .assert_ok(); - gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup.increment_block_timestamp(LOCKING_PERIOD_BLOCKS); gov_setup .b_mock diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 2ce94956d..41802b5da 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -10,7 +10,7 @@ use governance_v2::{ }; use multiversx_sc::{ codec::multi_types::OptionalValue, - types::{Address, BigInt, EsdtLocalRole, ManagedVec, MultiValueEncoded}, + types::{Address, BigInt, DurationSeconds, EsdtLocalRole, ManagedVec, MultiValueEncoded}, }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, @@ -23,8 +23,11 @@ use num_bigint::BigUint; pub const MIN_ENERGY_FOR_PROPOSE: u64 = 0; pub const MIN_FEE_FOR_PROPOSE: u64 = 1_000_000_000; // 1B MEX pub const QUORUM_PERCENTAGE: u64 = 4_000; // 40% -pub const VOTING_DELAY_BLOCKS: u64 = 1; -pub const VOTING_PERIOD_BLOCKS: u64 = 144_000; // 10 days +pub const VOTING_DELAY_SECONDS: DurationSeconds = DurationSeconds::new(1); +pub const VOTING_PERIOD_SECONDS: DurationSeconds = DurationSeconds::new(144_000); // 10 days + +// Raw u64 values for test time advancement +pub const VOTING_PERIOD_BLOCKS: u64 = 144_000; pub const LOCKING_PERIOD_BLOCKS: u64 = 30; pub const WITHDRAW_PERCENTAGE: u64 = 5_000; // 50% pub const MEX_TOKEN_ID: &[u8] = b"MEX-123456"; @@ -45,7 +48,7 @@ where pub third_user: Address, pub no_energy_user: Address, pub gov_wrapper: ContractObjWrapper, GovBuilder>, - pub current_block: u64, + pub current_timestamp: u64, } impl GovSetup @@ -81,25 +84,25 @@ where .execute_tx(&owner, &energy_factory_wrapper, &rust_zero, |sc| { sc.init(); sc.user_energy(&managed_address!(&first_user)) - .set(&Energy::new( + .set(Energy::new( BigInt::from(managed_biguint!(USER_ENERGY)), 0, managed_biguint!(0), )); sc.user_energy(&managed_address!(&second_user)) - .set(&Energy::new( + .set(Energy::new( BigInt::from(managed_biguint!(USER_ENERGY)), 0, managed_biguint!(0), )); sc.user_energy(&managed_address!(&third_user)) - .set(&Energy::new( + .set(Energy::new( BigInt::from(managed_biguint!(USER_ENERGY + 210_000)), 0, managed_biguint!(0), )); sc.user_energy(&managed_address!(&no_energy_user)) - .set(&Energy::new( + .set(Energy::new( BigInt::from(managed_biguint!(0)), 0, managed_biguint!(0), @@ -166,8 +169,8 @@ where managed_biguint!(MIN_ENERGY_FOR_PROPOSE), managed_biguint!(MIN_FEE_FOR_PROPOSE) * DECIMALS_CONST, QUORUM_PERCENTAGE, - VOTING_DELAY_BLOCKS, - VOTING_PERIOD_BLOCKS, + VOTING_DELAY_SECONDS, + VOTING_PERIOD_SECONDS, WITHDRAW_PERCENTAGE, managed_address!(energy_factory_wrapper.address_ref()), managed_address!(fees_collector_wrapper.address_ref()), @@ -193,7 +196,7 @@ where third_user, no_energy_user, gov_wrapper, - current_block: 0, + current_timestamp: 0, } } @@ -307,8 +310,9 @@ where ) }) } - pub fn increment_block_nonce(&mut self, inc_amount: u64) { - self.current_block += inc_amount; - self.b_mock.set_block_nonce(self.current_block); + + pub fn increment_block_timestamp(&mut self, inc_seconds: u64) { + self.current_timestamp += inc_seconds; + self.b_mock.set_block_timestamp(self.current_timestamp); } } diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index 0211fca5a..90ccd4f4b 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -28,13 +28,13 @@ multiversx_sc_wasm_adapter::endpoints! { changeMinFeeForProposal => change_min_fee_for_propose changeQuorumPercentage => change_quorum_percentage changeWithdrawPercentage => change_withdraw_percentage - changeVotingDelayInBlocks => change_voting_delay_in_blocks - changeVotingPeriodInBlocks => change_voting_period_in_blocks + changeVotingDelayInSeconds => change_voting_delay_in_seconds + changeVotingPeriodInSeconds => change_voting_period_in_seconds getMinEnergyForPropose => min_energy_for_propose getMinFeeForPropose => min_fee_for_propose getQuorum => quorum_percentage - getVotingDelayInBlocks => voting_delay_in_blocks - getVotingPeriodInBlocks => voting_period_in_blocks + getVotingDelayInSeconds => voting_delay_in_seconds + getVotingPeriodInSeconds => voting_period_in_seconds getFeeTokenId => fee_token_id getWithdrawPercentageDefeated => withdraw_percentage_defeated getProposals => proposals