diff --git a/apps/src/lib/node/ledger/shell/finalize_block.rs b/apps/src/lib/node/ledger/shell/finalize_block.rs index 1ea5da2a7a..4fef1fc7ef 100644 --- a/apps/src/lib/node/ledger/shell/finalize_block.rs +++ b/apps/src/lib/node/ledger/shell/finalize_block.rs @@ -3832,6 +3832,7 @@ mod test_finalize_block { let (mut shell, _recv, _, _) = setup_with_cfg(SetupCfg { last_height: 0, num_validators, + ..Default::default() }); let mut params = read_pos_params(&shell.wl_storage).unwrap(); params.owned.unbonding_len = 4; diff --git a/proof_of_stake/src/tests/state_machine_v2.rs b/proof_of_stake/src/tests/state_machine_v2.rs index ce2e0e6817..02df1b39a0 100644 --- a/proof_of_stake/src/tests/state_machine_v2.rs +++ b/proof_of_stake/src/tests/state_machine_v2.rs @@ -1875,6 +1875,8 @@ enum Transition { #[derivative(Debug = "ignore")] consensus_key: PublicKey, #[derivative(Debug = "ignore")] + protocol_key: PublicKey, + #[derivative(Debug = "ignore")] eth_cold_key: PublicKey, #[derivative(Debug = "ignore")] eth_hot_key: PublicKey, @@ -1981,6 +1983,7 @@ impl StateMachineTest for ConcretePosState { Transition::InitValidator { address, consensus_key, + protocol_key, eth_cold_key, eth_hot_key, commission_rate, @@ -1994,6 +1997,7 @@ impl StateMachineTest for ConcretePosState { params: ¶ms, address: &address, consensus_key: &consensus_key, + protocol_key: &protocol_key, eth_cold_key: ð_cold_key, eth_hot_key: ð_hot_key, current_epoch, @@ -3570,7 +3574,10 @@ impl ReferenceStateMachine for AbstractPosState { let epoch = Epoch::default(); let mut state = Self { epoch, - params, + params: PosParams { + owned: params, + ..Default::default() + }, genesis_validators: genesis_validators .into_iter() // Sorted by stake to fill in the consensus set first @@ -3592,6 +3599,7 @@ impl ReferenceStateMachine for AbstractPosState { address, tokens, consensus_key: _, + protocol_key: _, eth_cold_key: _, eth_hot_key: _, commission_rate: _, @@ -3712,6 +3720,7 @@ impl ReferenceStateMachine for AbstractPosState { 1 => ( address::testing::arb_established_address(), key::testing::arb_common_keypair(), + key::testing::arb_common_keypair(), key::testing::arb_common_secp256k1_keypair(), key::testing::arb_common_secp256k1_keypair(), arb_rate(), @@ -3721,6 +3730,7 @@ impl ReferenceStateMachine for AbstractPosState { |( addr, consensus_key, + protocol_key, eth_hot_key, eth_cold_key, commission_rate, @@ -3729,6 +3739,7 @@ impl ReferenceStateMachine for AbstractPosState { Transition::InitValidator { address: Address::Established(addr), consensus_key: consensus_key.to_public(), + protocol_key: protocol_key.to_public(), eth_hot_key: eth_hot_key.to_public(), eth_cold_key: eth_cold_key.to_public(), commission_rate, @@ -3871,6 +3882,7 @@ impl ReferenceStateMachine for AbstractPosState { Transition::InitValidator { address, consensus_key: _, + protocol_key: _, eth_cold_key: _, eth_hot_key: _, commission_rate: _, @@ -4214,6 +4226,7 @@ impl ReferenceStateMachine for AbstractPosState { Transition::InitValidator { address, consensus_key: _, + protocol_key: _, eth_cold_key: _, eth_hot_key: _, commission_rate: _, diff --git a/wasm/wasm_source/src/tx_redelegate.rs b/wasm/wasm_source/src/tx_redelegate.rs index 338e0205d7..adae605a81 100644 --- a/wasm/wasm_source/src/tx_redelegate.rs +++ b/wasm/wasm_source/src/tx_redelegate.rs @@ -21,7 +21,7 @@ fn apply_tx(ctx: &mut Ctx, tx_data: Tx) -> TxResult { mod tests { use std::collections::BTreeSet; - use namada::ledger::pos::{PosParams, PosVP}; + use namada::ledger::pos::{OwnedPosParams, PosVP}; use namada::proof_of_stake::types::{GenesisValidator, WeightedValidator}; use namada::proof_of_stake::{ bond_handle, read_consensus_validator_set_addresses_with_stake, @@ -68,10 +68,10 @@ mod tests { initial_stake: token::Amount, redelegation: transaction::pos::Redelegation, key: key::common::SecretKey, - pos_params: PosParams, + pos_params: OwnedPosParams, ) -> TxResult { // Remove the validator stake threshold for simplicity - let pos_params = PosParams { + let pos_params = OwnedPosParams { validator_stake_threshold: token::Amount::zero(), ..pos_params }; @@ -79,6 +79,7 @@ mod tests { let consensus_key_1 = key::testing::keypair_1().ref_to(); let consensus_key_2 = key::testing::keypair_2().ref_to(); + let protocol_key = key::testing::keypair_2().ref_to(); let eth_cold_key = key::testing::keypair_3().ref_to(); let eth_hot_key = key::testing::keypair_4().ref_to(); let commission_rate = Dec::new(5, 2).expect("Cannot fail"); @@ -89,6 +90,7 @@ mod tests { address: redelegation.src_validator.clone(), tokens: token::Amount::zero(), consensus_key: consensus_key_1, + protocol_key: protocol_key.clone(), eth_cold_key: eth_cold_key.clone(), eth_hot_key: eth_hot_key.clone(), commission_rate, @@ -98,6 +100,7 @@ mod tests { address: redelegation.dest_validator.clone(), tokens: token::Amount::zero(), consensus_key: consensus_key_2, + protocol_key, eth_cold_key, eth_hot_key, commission_rate, @@ -105,7 +108,8 @@ mod tests { }, ]; - init_pos(&genesis_validators[..], &pos_params, Epoch(0)); + let pos_params = + init_pos(&genesis_validators[..], &pos_params, Epoch(0)); let native_token = tx_host_env::with(|tx_env| { let native_token = tx_env.wl_storage.storage.native_token.clone();