Skip to content

Commit

Permalink
Adapted BaseTxJson
Browse files Browse the repository at this point in the history
  • Loading branch information
xrtm000 committed Nov 28, 2023
1 parent 093fd82 commit f189e04
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.wavesplatform.transaction.serialization.impl

import com.wavesplatform.transaction.{PBSince, ProvenTransaction, SigProofsSwitch, Transaction, Versioned}
import com.wavesplatform.transaction.{EthereumTransaction, PBSince, ProvenTransaction, SigProofsSwitch, Transaction, Versioned}
import play.api.libs.json.{JsArray, JsObject, JsString, Json}

object BaseTxJson {
Expand All @@ -12,11 +12,13 @@ object BaseTxJson {
"feeAssetId" -> tx.assetFee._1.maybeBase58Repr,
"timestamp" -> tx.timestamp
) ++ (tx match {
case v: Versioned => Json.obj("version" -> v.version)
case _ => Json.obj()
case v: Versioned => Json.obj("version" -> v.version)
case _: EthereumTransaction => Json.obj("version" -> 1)
case _ => Json.obj()
}) ++ (tx match {
case pbs: PBSince with Versioned if PBSince.affects(pbs) => Json.obj("chainId" -> tx.chainId)
case _ => Json.obj()
case e: EthereumTransaction => Json.obj("chainId" -> e.chainId)
case _ => Json.obj()
}) ++ (tx match {
case p: ProvenTransaction =>
Json.obj(
Expand Down

0 comments on commit f189e04

Please sign in to comment.