|
|
@ -52,6 +52,8 @@ import org.hyperledger.enclave.testutil.TesseraTestHarness; |
|
|
|
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory; |
|
|
|
import org.hyperledger.enclave.testutil.TesseraTestHarnessFactory; |
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigInteger; |
|
|
|
import java.math.BigInteger; |
|
|
|
|
|
|
|
import java.nio.file.Files; |
|
|
|
|
|
|
|
import java.nio.file.Path; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Base64; |
|
|
|
import java.util.Base64; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
@ -59,15 +61,14 @@ import java.util.Optional; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import io.vertx.core.Vertx; |
|
|
|
import io.vertx.core.Vertx; |
|
|
|
import org.apache.tuweni.bytes.Bytes; |
|
|
|
import org.apache.tuweni.bytes.Bytes; |
|
|
|
import org.junit.After; |
|
|
|
import org.junit.jupiter.api.AfterEach; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.ClassRule; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.jupiter.api.io.TempDir; |
|
|
|
import org.junit.rules.TemporaryFolder; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class PrivGetPrivateTransactionIntegrationTest { |
|
|
|
public class PrivGetPrivateTransactionIntegrationTest { |
|
|
|
|
|
|
|
|
|
|
|
@ClassRule public static final TemporaryFolder folder = new TemporaryFolder(); |
|
|
|
@TempDir private static Path folder; |
|
|
|
private static final String ENCLAVE_PUBLIC_KEY = "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="; |
|
|
|
private static final String ENCLAVE_PUBLIC_KEY = "A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="; |
|
|
|
|
|
|
|
|
|
|
|
private final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY; |
|
|
|
private final PrivacyIdProvider privacyIdProvider = (user) -> ENCLAVE_PUBLIC_KEY; |
|
|
@ -118,16 +119,14 @@ public class PrivGetPrivateTransactionIntegrationTest { |
|
|
|
private Enclave enclave; |
|
|
|
private Enclave enclave; |
|
|
|
private PrivacyController privacyController; |
|
|
|
private PrivacyController privacyController; |
|
|
|
|
|
|
|
|
|
|
|
@Before |
|
|
|
@BeforeEach |
|
|
|
public void setUp() throws Exception { |
|
|
|
public void setUp() throws Exception { |
|
|
|
folder.create(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vertx = Vertx.vertx(); |
|
|
|
vertx = Vertx.vertx(); |
|
|
|
|
|
|
|
|
|
|
|
testHarness = |
|
|
|
testHarness = |
|
|
|
TesseraTestHarnessFactory.create( |
|
|
|
TesseraTestHarnessFactory.create( |
|
|
|
"enclave", |
|
|
|
"enclave", |
|
|
|
folder.newFolder().toPath(), |
|
|
|
Files.createTempDirectory(folder, "enclave"), |
|
|
|
new EnclaveKeyConfiguration("enclave_key_0.pub", "enclave_key_0.key"), |
|
|
|
new EnclaveKeyConfiguration("enclave_key_0.pub", "enclave_key_0.key"), |
|
|
|
Optional.empty()); |
|
|
|
Optional.empty()); |
|
|
|
|
|
|
|
|
|
|
@ -141,7 +140,7 @@ public class PrivGetPrivateTransactionIntegrationTest { |
|
|
|
blockchain, privateStateStorage, enclave, null, null, null, null, null); |
|
|
|
blockchain, privateStateStorage, enclave, null, null, null, null, null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@After |
|
|
|
@AfterEach |
|
|
|
public void tearDown() { |
|
|
|
public void tearDown() { |
|
|
|
testHarness.close(); |
|
|
|
testHarness.close(); |
|
|
|
vertx.close(); |
|
|
|
vertx.close(); |
|
|
|