-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NODE-2616 Refactored validation of transaction version #3906
NODE-2616 Refactored validation of transaction version #3906
Conversation
@@ -1,11 +1,19 @@ | |||
package com.wavesplatform.transaction | |||
|
|||
trait VersionedTransaction { | |||
def version: TxVersion | |||
val version: TxVersion | |||
val maxVersion: TxVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving maxVersion
to TransactionType
would better reflect the reality, since max version is a property of transaction type, rather than some particular transaction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored
…factored-tx-version-validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EthereumTransaction
should be neitherVersionedTransaction
norPBSince
@@ -1,11 +1,13 @@ | |||
package com.wavesplatform.transaction | |||
|
|||
trait VersionedTransaction { | |||
def version: TxVersion | |||
sealed trait VersionedTransaction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sealed trait VersionedTransaction { | |
sealed trait VersionedTransaction { | |
def version: TxVersion | |
protected def maxVersion: TxVersion | |
def isVersionValid: Boolean = 0 < version && version <= maxVersion | |
} | |
object VersionedTransaction { | |
trait OnlyV1 extends VersionedTransaction { | |
override val version: TxVersion = TxVersion.V1 | |
override val maxVersion: TxVersion = TxVersion.V1 | |
} | |
trait ToV2 extends VersionedTransaction { | |
override val maxVersion: TxVersion = TxVersion.V2 | |
} | |
trait ToV3 extends VersionedTransaction { | |
override val maxVersion: TxVersion = TxVersion.V3 | |
} | |
} |
…factored-tx-version-validation
No description provided.