From b30dcc8e239aa7e3861a1867a703062a5aefb8da Mon Sep 17 00:00:00 2001 From: Alexandru Catalin Filip Date: Wed, 13 Nov 2024 16:19:58 +0200 Subject: [PATCH] extend conversion process documentation --- .../framework/aptos-framework/sources/delegation_pool.move | 2 ++ .../framework/aptos-framework/sources/staking_contract.move | 2 ++ 2 files changed, 4 insertions(+) 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,