-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NODE-2609 Fix generating balance restoration
- Loading branch information
Ivan Mashonskii
committed
Sep 30, 2023
1 parent
6788996
commit 7bed2d4
Showing
6 changed files
with
35 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
node/src/main/scala/com/wavesplatform/state/BalanceSnapshot.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package com.wavesplatform.state | ||
|
||
case class BalanceSnapshot(height: Int, regularBalance: Long, leaseIn: Long, leaseOut: Long, isBanned: Boolean) { | ||
lazy val effectiveBalance = if (!isBanned) regularBalance + leaseIn - leaseOut else 0L | ||
case class BalanceSnapshot(height: Int, regularBalance: Long, leaseIn: Long, leaseOut: Long) { | ||
lazy val effectiveBalance = regularBalance + leaseIn - leaseOut | ||
} | ||
|
||
object BalanceSnapshot { | ||
def apply(height: Int, p: Portfolio, isBanned: Boolean): BalanceSnapshot = | ||
BalanceSnapshot(height, p.balance, p.lease.in, p.lease.out, isBanned) | ||
def apply(height: Int, p: Portfolio): BalanceSnapshot = | ||
BalanceSnapshot(height, p.balance, p.lease.in, p.lease.out) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters