You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Identity top-up result: return the credits the top-up added #5852
An identity top-up funded from an asset lock returns only the identity's balance after the transition. The client cannot tell how many credits the top-up itself added: Drive credits the asset lock's remaining_credit_value and then charges the transition's fee from it, and that fee never reaches the client.
The wallet has to know the top-up's own share when it watches an identity's balance for incoming credits from other people. With supplied credits S, fee F and a payment X from someone else landing while the top-up runs, the returned balance is B + S − F + X. Without F, the wallet cannot separate X from its own top-up. A payment up to F is absorbed, and a larger one is understated by F (dashpay/dashwallet-ios#1344).
Where the number already is
rs-drive-abci/src/abci/app/execution_result.rs puts actual_fees.total_base_fee() into ExecTxResult.gas_used for a successful execution.
rs-dapi receives ExecTxResult from Tenderdash but WaitForStateTransitionResultResponse returns only the proof (or owner_balance) and metadata.
rs-sdkTopUpIdentity::top_up_identity_* returns the balance only. rs-platform-wallettop_up_identity_with_funding, platform_wallet_top_up_identity_with_funding_signer and SwiftDashSDK ManagedPlatformWallet.topUpIdentityWithFunding pass that balance on.
Proposal
Return the credits the top-up added (or the fee it paid) next to the balance:
dapi-grpc: a field on WaitForStateTransitionResultResponseV0 for the executed transition's fee.
rs-dapi: fill it from ExecTxResult.gas_used.
rs-sdk → rs-platform-wallet → FFI → SwiftDashSDK: return the credited amount with the balance (absent when the node does not send it).
Open points: whether the fee charged equals total_base_fee() exactly (user_fee_increase, refunds), and that the value is not covered by the GroveDB proof.
Activity