Skip to content

Commit

Permalink
Limited use of Versioned
Browse files Browse the repository at this point in the history
  • Loading branch information
xrtm000 committed Nov 28, 2023
1 parent a941491 commit 093fd82
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ final case class TransactionJsonSerializer(blockchain: Blockchain, commonApi: Co
gen.writeNumberField("fee", tx.assetFee._2, numbersAsString)
tx.assetFee._1.maybeBase58Repr.foreach(gen.writeStringField("feeAssetId", _))
gen.writeNumberField("timestamp", tx.timestamp, numbersAsString)
gen.writeNumberField("version", tx.version, numbersAsString)
if (PBSince.affects(tx)) gen.writeNumberField("chainId", tx.chainId, numbersAsString)
gen.writeNumberField("version", 1, numbersAsString)
gen.writeNumberField("chainId", tx.chainId, numbersAsString)
gen.writeStringField("bytes", EthEncoding.toHexString(tx.bytes()))
gen.writeStringField("sender", tx.senderAddress().toString)
gen.writeStringField("senderPublicKey", tx.signerPublicKey().toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ final case class EthereumTransaction(
override val chainId: Byte
) extends Transaction(TransactionType.Ethereum)
with Authorized
with Versioned.ConstV1
with PBSince.V1 { self =>
import EthereumTransaction.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import play.api.libs.json.JsObject
import scala.util.Try

case class GenesisTransaction(recipient: Address, amount: TxNonNegativeAmount, timestamp: TxTimestamp, signature: ByteStr, chainId: Byte)
extends Transaction(TransactionType.Genesis)
with Versioned.ConstV1 {
extends Transaction(TransactionType.Genesis) {
override val assetFee: (Asset, Long) = (Waves, 0)
override val id: Coeval[ByteStr] = Coeval.evalOnce(signature)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ case class PaymentTransaction(
chainId: Byte
) extends Transaction(TransactionType.Payment)
with ProvenTransaction
with Versioned.ConstV1
with TxWithFee.InWaves {

val bodyBytes: Coeval[Array[Byte]] = Coeval.evalOnce(PaymentTxSerializer.bodyBytes(this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.wavesplatform.transaction.validation.TxValidator
import scala.util.Try

trait TransactionParser {
type TransactionT <: Transaction with Versioned
type TransactionT <: Transaction

def typeId: TxType

Expand Down

0 comments on commit 093fd82

Please sign in to comment.