Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Fix acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iikirilov committed Jul 11, 2019
1 parent 57bbb86 commit 5d61d1c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package tech.pegasys.pantheon.tests.web3j.privacy;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;
import static tech.pegasys.pantheon.tests.web3j.privacy.PrivacyGroup.generatePrivacyGroup;
Expand All @@ -23,6 +22,7 @@
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.PrivateTransactionBuilder;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.PrivateTransactionBuilder.TransactionType;
import tech.pegasys.pantheon.util.bytes.BytesValue;
import tech.pegasys.pantheon.util.bytes.BytesValues;

import java.util.Base64;

Expand All @@ -32,7 +32,7 @@
import org.junit.Before;
import org.junit.Test;

public class PrivateTxEnclaveErrorAcceptanceTest extends PrivacyAcceptanceTestBase {
public class EnclaveErrorAcceptanceTest extends PrivacyAcceptanceTestBase {
protected static final String CONTRACT_NAME = "Event Emitter";

private EventEmitterHarness eventEmitterHarness;
Expand All @@ -54,7 +54,8 @@ public void setUp() throws Exception {
privateTransactionVerifier,
eea);
wrongPublicKey =
BytesValue.wrap(Base64.getEncoder().encode(Box.KeyPair.random().publicKey().bytesArray()));
BytesValues.fromBase64(
Base64.getEncoder().encode(Box.KeyPair.random().publicKey().bytesArray()));
}

@Test
Expand Down Expand Up @@ -91,8 +92,7 @@ public void enclaveNoPeerUrlError() {
.nonce(privacyNet.getNode("Alice").nextNonce(privacyGroup))
.from(privacyNet.getNode("Alice").getAddress())
.privateFrom(
BytesValue.wrap(
privacyNet.getEnclave("Alice").getPublicKeys().get(0).getBytes(UTF_8)))
BytesValues.fromBase64(privacyNet.getEnclave("Alice").getPublicKeys().get(0)))
.privateFor(Lists.newArrayList(wrongPublicKey))
.keyPair(privacyNet.getNode("Alice").keyPair())
.build(TransactionType.CREATE_CONTRACT);
Expand Down

0 comments on commit 5d61d1c

Please sign in to comment.