com.wavesplatform.state.LeaseBalance.scala Maven / Gradle / Ivy
The newest version!
package com.wavesplatform.state
import cats.Monad
import cats.implicits.{toFlatMapOps, toFunctorOps}
case class LeaseBalance(in: Long, out: Long) {
def combineF[F[_]: Monad](that: LeaseBalance)(implicit s: Summarizer[F]): F[LeaseBalance] =
for {
in <- s.sum(in, that.in, "Lease in")
out <- s.sum(out, that.out, "Lease out")
} yield LeaseBalance(in, out)
}
object LeaseBalance {
val empty: LeaseBalance = LeaseBalance(0, 0)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy