Skip to content

Fix deposit propagation into Ride. - #2193

Open
alexeykiselev wants to merge 1 commit into
determenistic-finality-featurefrom
fix-full-waves-balance-deposit
Open

Fix deposit propagation into Ride.#2193
alexeykiselev wants to merge 1 commit into
determenistic-finality-featurefrom
fix-full-waves-balance-deposit

Conversation

@alexeykiselev

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes how account deposits are propagated into the Ride execution environment by ensuring deposits are included in Waves spendable/effective balance calculations and related validation/error reporting.

Changes:

  • Extend types.WavesBalanceProfile with Deposit and subtract it in EffectiveBalance() and SpendableBalance().
  • Propagate Deposit from state into the WavesBalanceProfile returned by stateManager, and reuse ToFullWavesBalance() in Ride test helpers.
  • Update Ride diff-state balance math and validation/error formatting to account for deposit; add targeted unit tests across types, state, and ride.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/types/types.go Adds Deposit to WavesBalanceProfile and incorporates it into effective/spendable balance calculations.
pkg/types/types_test.go Adds unit tests verifying deposit impacts full balance derivation and error behavior.
pkg/state/state.go Plumbs deposit into WavesBalanceProfile returned to Ride and removes obsolete TODOs.
pkg/state/state_test.go Adds integration-style test ensuring committed/newest full balances reflect deposit and profile exposes deposit.
pkg/ride/test_helpers_test.go Reuses WavesBalanceProfile.ToFullWavesBalance() in test env to keep Ride helper logic consistent with core balance logic.
pkg/ride/environment.go Includes deposit in scala-like effective validation and improves error state formatting to include deposit.
pkg/ride/diff_state.go Tracks deposit in diffBalance, subtracts it from spendable/effective, and loads deposit from state profile safely.
pkg/ride/diff_state_test.go Adds tests confirming deposit affects Ride diff balances and validation paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants