From 9376b2476c904cf6dc75de385caa47c2e02d3676 Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Mon, 2 Sep 2024 15:59:15 +0300 Subject: [PATCH] wip --- .github/workflows/publish-docker-image.yml | 2 ++ build.sbt | 12 +++++++++--- src/main/scala/units/ELUpdater.scala | 2 +- .../units/client/contract/ContractFunction.scala | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml index af066035..4563687d 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-docker-image.yml @@ -52,6 +52,8 @@ jobs: pull: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max - uses: actions/attest-build-provenance@v1 with: subject-name: ${{ env.IMAGE_NAME}} diff --git a/build.sbt b/build.sbt index c0dfff97..20455839 100644 --- a/build.sbt +++ b/build.sbt @@ -63,10 +63,16 @@ def universalDepMappings(deps: Seq[Attributed[File]]): Seq[(File, String)] = dep <- deps } yield dep.data -> ("lib/" + getJarFullFilename(dep)) +Universal / mappings += { + val jar = (Compile / packageBin).value + val id = projectID.value + val art = (Compile / packageBin / artifact).value + jar -> ("lib/" + makeJarName(id.organization, id.name, id.revision, art.name, art.classifier)) +} Universal / mappings ++= universalDepMappings((Runtime / dependencyClasspath).value.filterNot { p => - p.get(AttributeKey[ModuleID]("moduleID")).exists { m => - m.organization == "org.scala-lang" || - m.organization.startsWith("com.fasterxml.jackson") + p.get(AttributeKey[ModuleID]("moduleID")).exists { m => false +// m.organization == "org.scala-lang" || +// m.organization.startsWith("com.fasterxml.jackson") } }) diff --git a/src/main/scala/units/ELUpdater.scala b/src/main/scala/units/ELUpdater.scala index 8c962488..8d41d1c4 100644 --- a/src/main/scala/units/ELUpdater.scala +++ b/src/main/scala/units/ELUpdater.scala @@ -179,7 +179,7 @@ class ELUpdater( Proofs.empty, blockchain.settings.addressSchemeCharacter.toByte ).signWith(invoker.privateKey) - logger.info(s"Invoking $contractAddress '${fc.function.funcName}' for block ${blockData.hash}->${blockData.parentHash}, txId=${tx.id()}") + logger.info(s"Invoking $contractAddress '${fc.function.funcName}' for block ${blockData.hash}->${blockData.parentHash}, txId=${tx.json()}") cleanPriorityPool() broadcastTx(tx).resultE match { diff --git a/src/main/scala/units/client/contract/ContractFunction.scala b/src/main/scala/units/client/contract/ContractFunction.scala index 17ed5fed..b982e1bf 100644 --- a/src/main/scala/units/client/contract/ContractFunction.scala +++ b/src/main/scala/units/client/contract/ContractFunction.scala @@ -8,11 +8,12 @@ import com.wavesplatform.lang.v1.compiler.Terms.{CONST_BYTESTR, CONST_LONG, CONS import units.{BlockHash, ClientError, Job} import units.util.HexBytesConverter.toHexNoPrefix import cats.syntax.either.* +import org.web3j.utils.Numeric.cleanHexPrefix abstract class ContractFunction(name: String, reference: BlockHash, extraArgs: Either[CommonError, List[EVALUATED]]) { def toFunctionCall(blockHash: BlockHash, transfersRootHash: Digest, lastClToElTransferIndex: Long): Job[FUNCTION_CALL] = (for { - hash <- CONST_STRING(toHexNoPrefix(blockHash.getBytes)) - ref <- CONST_STRING(toHexNoPrefix(reference.getBytes)) + hash <- CONST_STRING(cleanHexPrefix(blockHash)) + ref <- CONST_STRING(cleanHexPrefix(reference)) trh <- CONST_STRING(toHexNoPrefix(transfersRootHash)) xtra <- extraArgs } yield FUNCTION_CALL(