diff --git a/aptos-move/framework/aptos-framework/sources/delegation_pool.move b/aptos-move/framework/aptos-framework/sources/delegation_pool.move index 84a9a633c2a6e..13d45f5d23a53 100644 --- a/aptos-move/framework/aptos-framework/sources/delegation_pool.move +++ b/aptos-move/framework/aptos-framework/sources/delegation_pool.move @@ -899,6 +899,8 @@ module aptos_framework::delegation_pool { /// Initialize a delegation pool from an existing owned staking contract. /// The newly created delegation pool will preserve the operator and commission fee. The staker becomes the pool /// owner and has the same delegated voter set. + /// The conversion fails if there is any pending-active stake on the staking contract or if the staker already owns + /// a delegation pool. public entry fun initialize_delegation_pool_from_staking_contract( staker: &signer, operator: address, diff --git a/aptos-move/framework/aptos-framework/sources/staking_contract.move b/aptos-move/framework/aptos-framework/sources/staking_contract.move index 0c9fb1515413c..630ece19b4eba 100644 --- a/aptos-move/framework/aptos-framework/sources/staking_contract.move +++ b/aptos-move/framework/aptos-framework/sources/staking_contract.move @@ -784,6 +784,8 @@ module aptos_framework::staking_contract { // withdraw entire inactive stake and unlock commission produced so far distribute_internal(staker_address, operator, &mut staking_contract, &mut store.distribute_events); + // pending-inactive commission will be converted into pending-inactive shares owned by the operator + // within the newly created delegation pool request_commission_internal( operator, &mut staking_contract,