Skip to content

Commit

Permalink
add internal process
Browse files Browse the repository at this point in the history
Signed-off-by: George Tebrean <george@web3labs.com>
  • Loading branch information
gtebrean committed Sep 28, 2023
1 parent 8200e98 commit 42ce446
Show file tree
Hide file tree
Showing 8 changed files with 467 additions and 49 deletions.
25 changes: 25 additions & 0 deletions acceptance-tests/tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ configurations.all {
}
}

configurations {
tessera.extendsFrom integrationTestRuntimeOnly
}

web3j { generatedPackageName = 'org.hyperledger.besu.tests.web3j.generated' }

sourceSets.main.solidity.srcDirs = ["$projectDir/contracts"]
Expand Down Expand Up @@ -86,6 +90,7 @@ dependencies {
testImplementation 'org.web3j:core'

testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
tessera 'net.consensys.quorum.tessera:tessera-dist:23.4.0@tar'
}

test.enabled = false
Expand Down Expand Up @@ -235,4 +240,24 @@ task acceptanceTestPermissioning(type: Test) {
}

doFirst { mkdir "${buildDir}/jvmErrorLogs" }

def tesseraDist = '23.4.0'
acceptanceTest {
useJUnitPlatform()
systemProperty "tessera-dist", "${buildDir}/tessera/dist/tessera-${tesseraDist}/bin/tessera"
}

task copyDependencies(type: Copy) {
def outputDir = file("${buildDir}/tessera/dist")
from configurations.tessera
into outputDir
}
task unzipTessera(type: Copy) {
def zipFile = file("${buildDir}/tessera/dist/tessera-dist-${tesseraDist}.tar")
def outputDir = file("${buildDir}/tessera/dist")
from tarTree(zipFile)
into outputDir
}
unzipTessera.dependsOn copyDependencies
acceptanceTest.dependsOn unzipTessera
}
26 changes: 25 additions & 1 deletion enclave/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
configurations {
tessera.extendsFrom integrationTestRuntimeOnly
}

dependencies {
api project(':util')
api project(':crypto:algorithms')
Expand All @@ -24,5 +28,25 @@ dependencies {
integrationTestImplementation 'org.awaitility:awaitility'
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api'
integrationTestImplementation 'org.mockito:mockito-core'
integrationTestImplementation 'org.testcontainers:testcontainers'
tessera 'net.consensys.quorum.tessera:tessera-dist:23.4.0@tar'
}

def tesseraDist = '23.4.0'
integrationTest {
useJUnitPlatform()
systemProperty "tessera-dist", "${buildDir}/tessera/dist/tessera-${tesseraDist}/bin/tessera"
}

task copyDependencies(type: Copy) {
def outputDir = file("${buildDir}/tessera/dist")
from configurations.tessera
into outputDir
}
task unzipTessera(type: Copy) {
def zipFile = file("${buildDir}/tessera/dist/tessera-dist-${tesseraDist}.tar")
def outputDir = file("${buildDir}/tessera/dist")
from tarTree(zipFile)
into outputDir
}
unzipTessera.dependsOn copyDependencies
integrationTest.dependsOn unzipTessera
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.hyperledger.besu.enclave.types.SendResponse;
import org.hyperledger.enclave.testutil.EnclaveEncryptorType;
import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration;
import org.hyperledger.enclave.testutil.TesseraTestHarness;
import org.hyperledger.enclave.testutil.EnclaveTestHarness;
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory;

import java.net.URI;
Expand Down Expand Up @@ -52,7 +52,7 @@ public class EnclaveTest {
private Vertx vertx;
private EnclaveFactory factory;

private TesseraTestHarness testHarness;
private EnclaveTestHarness testHarness;

@BeforeEach
public void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.hyperledger.besu.plugin.data.Restriction;
import org.hyperledger.enclave.testutil.EnclaveEncryptorType;
import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration;
import org.hyperledger.enclave.testutil.TesseraTestHarness;
import org.hyperledger.enclave.testutil.EnclaveTestHarness;
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory;

import java.math.BigInteger;
Expand Down Expand Up @@ -116,7 +116,7 @@ public class PrivGetPrivateTransactionIntegrationTest {
.signAndBuild(KEY_PAIR);

private Vertx vertx = Vertx.vertx();
private TesseraTestHarness testHarness;
private EnclaveTestHarness testHarness;
private Enclave enclave;
private PrivacyController privacyController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import org.hyperledger.besu.evm.worldstate.WorldUpdater;
import org.hyperledger.enclave.testutil.EnclaveEncryptorType;
import org.hyperledger.enclave.testutil.EnclaveKeyConfiguration;
import org.hyperledger.enclave.testutil.TesseraTestHarness;
import org.hyperledger.enclave.testutil.EnclaveTestHarness;
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory;

import java.nio.file.Files;
Expand Down Expand Up @@ -91,7 +91,7 @@ public class PrivacyPrecompiledContractIntegrationTest {
private static Enclave enclave;
private static MessageFrame messageFrame;

private static TesseraTestHarness testHarness;
private static EnclaveTestHarness testHarness;
private static WorldStateArchive worldStateArchive;
private static PrivateStateStorage privateStateStorage;
private static final Vertx vertx = Vertx.vertx();
Expand Down
8 changes: 8 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2872,6 +2872,14 @@
<sha256 value="ff66d886607137e2095f20c90ee093f3c80329164eff091a0688bdce37e3e6b2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.consensys.quorum.tessera" name="tessera-dist" version="23.4.0">
<artifact name="tessera-dist-23.4.0.pom">
<sha256 value="ab56343f4fc64278324184637f0f045fee930078a0b5ab8aaa269ba5d7ed05b7" origin="Generated by Gradle"/>
</artifact>
<artifact name="tessera-dist-23.4.0.tar">
<sha256 value="177763b9db5785331c8b01ff8d4706d407c7cc33311d01ebbf2fc373457394ff" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.java" name="jvnet-parent" version="3">
<artifact name="jvnet-parent-3.pom">
<sha256 value="30f5789efa39ddbf96095aada3fc1260c4561faf2f714686717cb2dc5049475a" origin="Generated by Gradle"/>
Expand Down
Loading

0 comments on commit 42ce446

Please sign in to comment.