-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
65 additions
and
74 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
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
27 changes: 13 additions & 14 deletions
27
node/src/main/scala/com/wavesplatform/transaction/PBSince.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,20 +1,19 @@ | ||
package com.wavesplatform.transaction | ||
|
||
import com.wavesplatform.transaction.PBSince.* | ||
sealed trait PBSince | ||
|
||
import scala.annotation.nowarn | ||
object PBSince { | ||
trait V1 extends PBSince | ||
trait V2 extends PBSince | ||
trait V3 extends PBSince | ||
|
||
sealed trait PBSince { self: Transaction & VersionedTransaction => | ||
lazy val protobufVersion: TxVersion = this match { | ||
case _: V1 => TxVersion.V1 | ||
case _: V2 => TxVersion.V2: @nowarn // scalac: unreachable code | ||
case _: V3 => TxVersion.V3 | ||
} | ||
final def isProtobufVersion: Boolean = self.version >= protobufVersion | ||
} | ||
def version(tx: PBSince): TxVersion = | ||
tx match { | ||
case _: V1 => TxVersion.V1 | ||
case _: V2 => TxVersion.V2 | ||
case _: V3 => TxVersion.V3 | ||
} | ||
|
||
object PBSince { | ||
trait V1 extends PBSince { self: Transaction & VersionedTransaction => } | ||
trait V2 extends PBSince { self: Transaction & VersionedTransaction => } | ||
trait V3 extends PBSince { self: Transaction & VersionedTransaction => } | ||
def affects(tx: PBSince & VersionedTransaction): Boolean = | ||
tx.version >= version(tx) | ||
} |
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
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
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
Oops, something went wrong.