Skip to content

Commit

Permalink
Remove NetworkBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mashonskiy committed Sep 25, 2024
1 parent 492970e commit 9208c16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 104 deletions.
96 changes: 0 additions & 96 deletions src/main/scala/units/NetworkBlock.scala

This file was deleted.

5 changes: 3 additions & 2 deletions src/test/scala/units/client/TestEcClients.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import units.client.engine.model.*
import units.client.engine.{EngineApiClient, LoggedEngineApiClient}
import units.collections.ListOps.*
import units.eth.EthAddress
import units.{BlockHash, JobResult, NetworkBlock}
import units.network.PayloadMessage
import units.{BlockHash, JobResult}

class TestEcClients private (
knownBlocks: Atomic[Map[BlockHash, ChainId]],
Expand Down Expand Up @@ -108,7 +109,7 @@ class TestEcClients private (
}

override def applyNewPayload(payloadJson: JsObject): JobResult[Option[BlockHash]] = {
val newPayload = NetworkBlock(payloadJson).explicitGet().toPayload
val newPayload = PayloadMessage(payloadJson).flatMap(_.payloadInfo).explicitGet().payload
knownBlocks.get().get(newPayload.parentHash) match {
case Some(cid) =>
val chain = chains.get()(cid)
Expand Down
6 changes: 0 additions & 6 deletions src/test/scala/units/client/engine/model/TestPayloads.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package units.client.engine.model

import com.wavesplatform.account.SeedKeyPair
import com.wavesplatform.common.utils.EitherExt2
import play.api.libs.json.{JsObject, Json}
import units.NetworkBlock
import units.util.HexBytesConverter.toHex

object TestPayloads {
def toNetworkBlock(payload: ExecutionPayload, miner: SeedKeyPair, prevRandao: String): NetworkBlock =
NetworkBlock.signed(TestPayloads.toPayloadJson(payload, prevRandao), miner.privateKey).explicitGet()

def toPayloadJson(payload: ExecutionPayload, prevRandao: String): JsObject = Json.obj(
"blockHash" -> payload.hash,
"timestamp" -> toHex(payload.timestamp),
Expand Down

0 comments on commit 9208c16

Please sign in to comment.