Skip to content

Commit d0647f0

Browse files
committed
remove validator correctly; add migration to remote validator at correct height
1 parent 6897d1f commit d0647f0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

contracts/dao/neutron-staking-tracker/src/contract.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ pub(crate) fn after_validator_created(
208208
pub(crate) fn after_validator_removed(
209209
deps: DepsMut,
210210
env: Env,
211-
valoper_address: String,
212211
_valcons_address: String,
212+
valoper_address: String,
213213
) -> Result<Response, ContractError> {
214214
let validator_addr = Addr::unchecked(&valoper_address);
215215

@@ -650,6 +650,12 @@ pub fn query_list_delegations(
650650
pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
651651
// Set contract to version to latest
652652
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
653+
654+
// Remove validator
655+
let validator_addr = Addr::unchecked("neutronvaloper1v9xys5c4zdr89tvwq983ycnj3j4pekpjwr0raa");
656+
let remove_height = 26438494;
657+
VALIDATORS.remove(deps.storage, &validator_addr, remove_height)?;
658+
653659
Ok(Response::default())
654660
}
655661

contracts/dao/neutron-staking-tracker/src/testing/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ fn test_after_validator_removed() {
246246
let res = after_validator_removed(
247247
deps.as_mut(),
248248
env.clone(),
249-
oper_addr.to_string(),
250249
cons_addr.to_string(),
250+
oper_addr.to_string(),
251251
);
252252
assert!(res.is_ok(), "Error: {:?}", res.err());
253253

0 commit comments

Comments
 (0)