Java Code Examples for org.web3j.utils.Base64String

The following examples show how to use org.web3j.utils.Base64String. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void transactionStoredInJsonArrayCanBeDecoded() {
  final JsonObject parameters = validEeaTransactionParameters();

  final JsonRpcRequest request = wrapParametersInRequest(parameters);
  final EeaSendTransactionJsonParameters txnParams =
      factory.fromRpcRequestToJsonParam(EeaSendTransactionJsonParameters.class, request);

  assertThat(txnParams.gas()).isEqualTo(getStringAsOptionalBigInteger(parameters, "gas"));
  assertThat(txnParams.gasPrice())
      .isEqualTo(getStringAsOptionalBigInteger(parameters, "gasPrice"));
  assertThat(txnParams.nonce()).isEqualTo(getStringAsOptionalBigInteger(parameters, "nonce"));
  assertThat(txnParams.receiver()).isEqualTo(Optional.of(parameters.getString("to")));
  assertThat(txnParams.value()).isEqualTo(getStringAsOptionalBigInteger(parameters, "value"));
  assertThat(txnParams.privateFrom())
      .isEqualTo(Base64String.wrap(parameters.getString("privateFrom")));
  assertThat(txnParams.privateFor().get())
      .containsExactly(Base64String.wrap(parameters.getJsonArray("privateFor").getString(0)));
  assertThat(txnParams.restriction()).isEqualTo(parameters.getString("restriction"));
}
 
Example 2
@Test
public void transactionNotStoredInJsonArrayCanBeDecoded() {
  final JsonObject parameters = validEeaTransactionParameters();

  final JsonRpcRequest request = wrapParametersInRequest(parameters);
  final EeaSendTransactionJsonParameters txnParams =
      factory.fromRpcRequestToJsonParam(EeaSendTransactionJsonParameters.class, request);

  assertThat(txnParams.gas()).isEqualTo(getStringAsOptionalBigInteger(parameters, "gas"));
  assertThat(txnParams.gasPrice())
      .isEqualTo(getStringAsOptionalBigInteger(parameters, "gasPrice"));
  assertThat(txnParams.nonce()).isEqualTo(getStringAsOptionalBigInteger(parameters, "nonce"));
  assertThat(txnParams.receiver()).isEqualTo(Optional.of(parameters.getString("to")));
  assertThat(txnParams.value()).isEqualTo(getStringAsOptionalBigInteger(parameters, "value"));
  assertThat(txnParams.privateFrom())
      .isEqualTo(Base64String.wrap(parameters.getString("privateFrom")));
  assertThat(txnParams.privateFor().get())
      .containsExactly(Base64String.wrap(parameters.getJsonArray("privateFor").getString(0)));
  assertThat(txnParams.restriction()).isEqualTo(parameters.getString("restriction"));
}
 
Example 3
Source Project: besu   Source File: PrivacyGroupAcceptanceTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void nodeCanCreatePrivacyGroup() {
  final String privacyGroupId =
      alice.execute(
          privacyTransactions.createPrivacyGroup(
              "myGroupName", "my group description", alice, bob));

  assertThat(privacyGroupId).isNotNull();

  final PrivacyGroup expected =
      new PrivacyGroup(
          privacyGroupId,
          PrivacyGroup.Type.PANTHEON,
          "myGroupName",
          "my group description",
          Base64String.wrapList(alice.getEnclaveKey(), bob.getEnclaveKey()));

  alice.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));

  bob.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));
}
 
Example 4
Source Project: besu   Source File: PrivacyGroupAcceptanceTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void nodeCanCreatePrivacyGroupWithoutName() {
  final String privacyGroupId =
      alice.execute(
          privacyTransactions.createPrivacyGroup(null, "my group description", alice, bob));

  assertThat(privacyGroupId).isNotNull();

  final PrivacyGroup expected =
      new PrivacyGroup(
          privacyGroupId,
          PrivacyGroup.Type.PANTHEON,
          "",
          "my group description",
          Base64String.wrapList(alice.getEnclaveKey(), bob.getEnclaveKey()));

  alice.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));

  bob.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));
}
 
Example 5
Source Project: web3j   Source File: JsonRpc2_0Besu.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Request<?, EthSendTransaction> privOnChainRemoveFromPrivacyGroup(
        final Base64String privacyGroupId,
        final Credentials credentials,
        final Base64String enclaveKey,
        final Base64String participant)
        throws IOException {
    BigInteger transactionCount =
            privGetTransactionCount(credentials.getAddress(), privacyGroupId)
                    .send()
                    .getTransactionCount();
    String removeFromContractCall =
            OnChainPrivacyTransactionBuilder.getEncodedRemoveFromGroupFunction(
                    enclaveKey, participant.raw());

    String removeFromProupTransactionPayload =
            OnChainPrivacyTransactionBuilder.buildOnChainPrivateTransaction(
                    privacyGroupId,
                    credentials,
                    enclaveKey,
                    transactionCount,
                    removeFromContractCall);

    return eeaSendRawTransaction(removeFromProupTransactionPayload);
}
 
Example 6
Source Project: besu   Source File: PrivacyGroupAcceptanceTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void nodeCanCreatePrivacyGroupWithoutOptionalParams() {
  final String privacyGroupId =
      alice.execute(privacyTransactions.createPrivacyGroup(null, null, alice, bob));

  assertThat(privacyGroupId).isNotNull();

  final PrivacyGroup expected =
      new PrivacyGroup(
          privacyGroupId,
          PrivacyGroup.Type.PANTHEON,
          "",
          "",
          Base64String.wrapList(alice.getEnclaveKey(), bob.getEnclaveKey()));

  alice.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));

  bob.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));
}
 
Example 7
Source Project: besu   Source File: PrivGetCodeAcceptanceTest.java    License: Apache License 2.0 6 votes vote down vote up
private String createPrivacyGroup() {
  final String privacyGroupId =
      alice.execute(
          privacyTransactions.createPrivacyGroup("myGroupName", "my group description", alice));

  assertThat(privacyGroupId).isNotNull();

  final PrivacyGroup expected =
      new PrivacyGroup(
          privacyGroupId,
          PrivacyGroup.Type.PANTHEON,
          "myGroupName",
          "my group description",
          Base64String.wrapList(alice.getEnclaveKey()));

  alice.verify(privateTransactionVerifier.validPrivacyGroupCreated(expected));

  return privacyGroupId;
}
 
Example 8
Source Project: web3j   Source File: BesuOnChainPrivacyIntegrationTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testCreateAndFindOnChainPrivacyGroup() throws Exception {
    Base64String privacyGroupId = Base64String.wrap(generateRandomBytes(32));
    final String txHash =
            nodeAlice
                    .privOnChainCreatePrivacyGroup(
                            privacyGroupId,
                            ALICE,
                            ENCLAVE_KEY_ALICE,
                            Collections.singletonList(ENCLAVE_KEY_BOB))
                    .send()
                    .getTransactionHash();

    TransactionReceipt receipt = processor.waitForTransactionReceipt(txHash);
    assertTrue(receipt.isStatusOK());

    List<PrivacyGroup> groups =
            nodeAlice
                    .privOnChainFindPrivacyGroup(
                            Arrays.asList(ENCLAVE_KEY_ALICE, ENCLAVE_KEY_BOB))
                    .send()
                    .getGroups();

    assertTrue(groups.stream().anyMatch(x -> x.getPrivacyGroupId().equals(privacyGroupId)));
}
 
Example 9
Source Project: web3j   Source File: RawPrivateTransaction.java    License: Apache License 2.0 6 votes vote down vote up
protected RawPrivateTransaction(
        final BigInteger nonce,
        final BigInteger gasPrice,
        final BigInteger gasLimit,
        final String to,
        final String data,
        final Base64String privateFrom,
        final List<Base64String> privateFor,
        final Base64String privacyGroupId,
        final Restriction restriction) {
    super(nonce, gasPrice, gasLimit, to, BigInteger.ZERO, data);
    this.privateFrom = privateFrom;
    this.privateFor = privateFor;
    this.privacyGroupId = privacyGroupId;
    this.restriction = restriction;
}
 
Example 10
Source Project: web3j   Source File: RawPrivateTransaction.java    License: Apache License 2.0 6 votes vote down vote up
protected RawPrivateTransaction(
        final BigInteger nonce,
        final BigInteger gasPremium,
        final BigInteger feeCap,
        final BigInteger gasLimit,
        final String to,
        final String data,
        final Base64String privateFrom,
        final List<Base64String> privateFor,
        final Base64String privacyGroupId,
        final Restriction restriction) {
    super(nonce, null, gasLimit, to, BigInteger.ZERO, data, gasPremium, feeCap);
    this.privateFrom = privateFrom;
    this.privateFor = privateFor;
    this.privacyGroupId = privacyGroupId;
    this.restriction = restriction;
}
 
Example 11
Source Project: web3j   Source File: RawPrivateTransaction.java    License: Apache License 2.0 6 votes vote down vote up
private RawPrivateTransaction(
        final RawTransaction rawTransaction,
        final Base64String privateFrom,
        final List<Base64String> privateFor,
        final Base64String privacyGroupId,
        final Restriction restriction) {
    this(
            rawTransaction.getNonce(),
            rawTransaction.getGasPrice(),
            rawTransaction.getGasLimit(),
            rawTransaction.getTo(),
            rawTransaction.getData(),
            privateFrom,
            privateFor,
            privacyGroupId,
            restriction);
}
 
Example 12
Source Project: web3j   Source File: PrivateTransactionEncoder.java    License: Apache License 2.0 6 votes vote down vote up
public static List<RlpType> asRlpValues(
        final RawPrivateTransaction privateTransaction,
        final Sign.SignatureData signatureData) {

    final List<RlpType> result =
            new ArrayList<>(
                    TransactionEncoder.asRlpValues(
                            privateTransaction.asRawTransaction(), signatureData));

    result.add(privateTransaction.getPrivateFrom().asRlp());

    privateTransaction
            .getPrivateFor()
            .ifPresent(privateFor -> result.add(Base64String.unwrapListToRlp(privateFor)));

    privateTransaction.getPrivacyGroupId().map(Base64String::asRlp).ifPresent(result::add);

    result.add(RlpString.create(privateTransaction.getRestriction().getRestriction()));

    return result;
}
 
Example 13
Source Project: web3j   Source File: PrivateTransactionManager.java    License: Apache License 2.0 6 votes vote down vote up
protected PrivateTransactionManager(
        final Besu besu,
        final BesuPrivacyGasProvider gasProvider,
        final Credentials credentials,
        final long chainId,
        final Base64String privateFrom,
        final int attempts,
        final int sleepDuration) {
    this(
            besu,
            gasProvider,
            credentials,
            chainId,
            privateFrom,
            new PollingPrivateTransactionReceiptProcessor(besu, sleepDuration, attempts));
}
 
Example 14
Source Project: ethsigner   Source File: BesuPrivateNonceProvider.java    License: Apache License 2.0 5 votes vote down vote up
public BesuPrivateNonceProvider(
    final String accountAddress,
    final Base64String privacyGroupId,
    final VertxNonceRequestTransmitter vertxNonceRequestTransmitter) {
  this.vertxNonceRequestTransmitter = vertxNonceRequestTransmitter;
  this.accountAddress = accountAddress;
  this.privacyGroupId = privacyGroupId;
}
 
Example 15
Source Project: ethsigner   Source File: BesuPrivateTransaction.java    License: Apache License 2.0 5 votes vote down vote up
public static BesuPrivateTransaction from(
    final EeaSendTransactionJsonParameters transactionJsonParameters,
    final NonceProvider nonceProvider,
    final JsonRpcRequestId id) {

  if (transactionJsonParameters.privacyGroupId().isEmpty()) {
    throw new IllegalArgumentException("Transaction does not contain a valid privacyGroup.");
  }

  final Base64String privacyId = transactionJsonParameters.privacyGroupId().get();
  return new BesuPrivateTransaction(transactionJsonParameters, nonceProvider, id, privacyId);
}
 
Example 16
Source Project: ethsigner   Source File: BesuPrivateTransaction.java    License: Apache License 2.0 5 votes vote down vote up
private BesuPrivateTransaction(
    final EeaSendTransactionJsonParameters transactionJsonParameters,
    final NonceProvider nonceProvider,
    final JsonRpcRequestId id,
    final Base64String privacyGroupId) {
  super(transactionJsonParameters, nonceProvider, id);
  this.privacyGroupId = privacyGroupId;
}
 
Example 17
Source Project: ethsigner   Source File: EeaPrivateNonceProvider.java    License: Apache License 2.0 5 votes vote down vote up
public EeaPrivateNonceProvider(
    final String accountAddress,
    final Base64String privateFrom,
    final List<Base64String> privateFor,
    final VertxNonceRequestTransmitter vertxNonceRequestTransmitter) {
  this.accountAddress = accountAddress;
  this.privateFrom = privateFrom;
  this.privateFor = privateFor;
  this.vertxNonceRequestTransmitter = vertxNonceRequestTransmitter;
}
 
Example 18
Source Project: web3j   Source File: PrivacyGroup.java    License: Apache License 2.0 5 votes vote down vote up
@JsonCreator
public PrivacyGroup(
        @JsonProperty(value = "privacyGroupId") final String privacyGroupId,
        @JsonProperty(value = "type") final Type type,
        @JsonProperty(value = "name") final String name,
        @JsonProperty(value = "description") final String description,
        @JsonProperty(value = "members") final List<Base64String> members) {
    this.privacyGroupId = Base64String.wrap(privacyGroupId);
    this.type = type;
    this.name = name;
    this.description = description;
    this.members = members;
}
 
Example 19
Source Project: web3j   Source File: PrivateTransaction.java    License: Apache License 2.0 5 votes vote down vote up
public PrivateTransaction(
        final String hash,
        final String nonce,
        final String from,
        final String to,
        final String value,
        final String gas,
        final String gasPrice,
        final String input,
        final String r,
        final String s,
        final String v,
        final Base64String privateFrom,
        final String restriction) {

    this.hash = hash;
    this.nonce = Numeric.decodeQuantity(nonce);
    this.from = from;
    this.to = to;
    this.value = Numeric.decodeQuantity(value);
    this.gasPrice = Numeric.decodeQuantity(gasPrice);
    this.gas = Numeric.decodeQuantity(gas);
    this.input = input;
    this.r = r;
    this.s = s;
    this.v = Numeric.decodeQuantity(v).longValue();
    this.privateFrom = privateFrom;
    this.restriction = Restriction.fromString(restriction);
}
 
Example 20
Source Project: ethsigner   Source File: EeaPrivateTransactionTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void rlpEncodesTransaction() {
  final SignatureData signatureData =
      new SignatureData(new byte[] {1}, new byte[] {2}, new byte[] {3});
  final byte[] rlpEncodedBytes = privateTransaction.rlpEncode(signatureData);
  final String rlpString = Numeric.toHexString(rlpEncodedBytes);

  final SignedRawPrivateTransaction decodedTransaction =
      (SignedRawPrivateTransaction) PrivateTransactionDecoder.decode(rlpString);
  assertThat(decodedTransaction.getTo()).isEqualTo("0xd46e8dd67c5d32be8058bb8eb970870f07244567");
  assertThat(decodedTransaction.getGasLimit()).isEqualTo(decodeQuantity("0x76c0"));
  assertThat(decodedTransaction.getGasPrice()).isEqualTo(decodeQuantity("0x9184e72a000"));
  assertThat(decodedTransaction.getNonce()).isEqualTo(decodeQuantity("0x1"));
  assertThat(decodedTransaction.getValue()).isEqualTo(decodeQuantity("0x0"));
  assertThat(decodedTransaction.getData())
      .isEqualTo(
          "d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675");
  assertThat(decodedTransaction.getRestriction()).isEqualTo(Restriction.RESTRICTED);

  final Base64String expectedDecodedPrivateFrom = params.privateFrom();
  final Base64String expectedDecodedPrivateFor = params.privateFor().get().get(0);

  assertThat(decodedTransaction.getPrivateFrom()).isEqualTo(expectedDecodedPrivateFrom);
  assertThat(decodedTransaction.getPrivateFor().get().get(0))
      .isEqualTo(expectedDecodedPrivateFor);

  final SignatureData decodedSignatureData = decodedTransaction.getSignatureData();
  assertThat(trimLeadingZeroes(decodedSignatureData.getV())).isEqualTo(new byte[] {1});
  assertThat(trimLeadingZeroes(decodedSignatureData.getR())).isEqualTo(new byte[] {2});
  assertThat(trimLeadingZeroes(decodedSignatureData.getS())).isEqualTo(new byte[] {3});
}
 
Example 21
Source Project: besu   Source File: PrivacyRequestFactory.java    License: Apache License 2.0 5 votes vote down vote up
public String privxAddToPrivacyGroup(
    final Base64String privacyGroupId, final PrivacyNode adder, final List<String> addresses)
    throws IOException, TransactionException {

  final BigInteger nonce =
      besuClient
          .privGetTransactionCount(adder.getAddress().toHexString(), privacyGroupId)
          .send()
          .getTransactionCount();

  final Bytes payload =
      encodeAddToGroupFunctionCall(
          Bytes.fromBase64String(adder.getEnclaveKey()),
          addresses.stream().map(Bytes::fromBase64String).collect(Collectors.toList()));

  final RawPrivateTransaction privateTransaction =
      RawPrivateTransaction.createTransaction(
          nonce,
          BigInteger.valueOf(1000),
          BigInteger.valueOf(3000000),
          Address.ONCHAIN_PRIVACY_PROXY.toHexString(),
          payload.toHexString(),
          Base64String.wrap(adder.getEnclaveKey()),
          privacyGroupId,
          org.web3j.utils.Restriction.RESTRICTED);

  return besuClient
      .eeaSendRawTransaction(
          Numeric.toHexString(
              PrivateTransactionEncoder.signMessage(
                  privateTransaction, Credentials.create(adder.getTransactionSigningKey()))))
      .send()
      .getTransactionHash();
}
 
Example 22
Source Project: besu   Source File: PrivacyRequestFactory.java    License: Apache License 2.0 5 votes vote down vote up
public String privxRemoveFromPrivacyGroup(
    final Base64String privacyGroupId, final PrivacyNode remover, final String toRemove)
    throws IOException, TransactionException {

  final BigInteger nonce =
      besuClient
          .privGetTransactionCount(remover.getAddress().toHexString(), privacyGroupId)
          .send()
          .getTransactionCount();

  final Bytes payload =
      encodeRemoveFromGroupFunctionCall(
          Bytes.fromBase64String(remover.getEnclaveKey()), Bytes.fromBase64String(toRemove));

  final RawPrivateTransaction privateTransaction =
      RawPrivateTransaction.createTransaction(
          nonce,
          BigInteger.valueOf(1000),
          BigInteger.valueOf(3000000),
          Address.ONCHAIN_PRIVACY_PROXY.toHexString(),
          payload.toHexString(),
          Base64String.wrap(remover.getEnclaveKey()),
          privacyGroupId,
          org.web3j.utils.Restriction.RESTRICTED);

  return besuClient
      .eeaSendRawTransaction(
          Numeric.toHexString(
              PrivateTransactionEncoder.signMessage(
                  privateTransaction, Credentials.create(remover.getTransactionSigningKey()))))
      .send()
      .getTransactionHash();
}
 
Example 23
Source Project: besu   Source File: PrivacyRequestFactory.java    License: Apache License 2.0 5 votes vote down vote up
public String privxLockPrivacyGroup(final PrivacyNode locker, final Base64String privacyGroupId)
    throws IOException, TransactionException {
  final BigInteger nonce =
      besuClient
          .privGetTransactionCount(locker.getAddress().toHexString(), privacyGroupId)
          .send()
          .getTransactionCount();

  final RawPrivateTransaction privateTransaction =
      RawPrivateTransaction.createTransaction(
          nonce,
          BigInteger.valueOf(1000),
          BigInteger.valueOf(3000000),
          Address.ONCHAIN_PRIVACY_PROXY.toHexString(),
          OnChainGroupManagement.LOCK_GROUP_METHOD_SIGNATURE.toHexString(),
          Base64String.wrap(locker.getEnclaveKey()),
          privacyGroupId,
          org.web3j.utils.Restriction.RESTRICTED);

  final String transactionHash =
      besuClient
          .eeaSendRawTransaction(
              Numeric.toHexString(
                  PrivateTransactionEncoder.signMessage(
                      privateTransaction, Credentials.create(locker.getTransactionSigningKey()))))
          .send()
          .getTransactionHash();

  final PrivateTransactionReceipt privateTransactionReceipt =
      new PollingPrivateTransactionReceiptProcessor(besuClient, 3000, 10)
          .waitForTransactionReceipt(transactionHash);

  assertThat(privateTransactionReceipt.getStatus()).isEqualTo("0x1");

  return privateTransactionReceipt.getcommitmentHash();
}
 
Example 24
Source Project: besu   Source File: PrivacyRequestFactory.java    License: Apache License 2.0 5 votes vote down vote up
public Request<?, PrivxFindPrivacyGroupResponse> privxFindOnChainPrivacyGroup(
    final List<Base64String> nodes) {
  return new Request<>(
      "privx_findOnChainPrivacyGroup",
      singletonList(nodes),
      web3jService,
      PrivxFindPrivacyGroupResponse.class);
}
 
Example 25
Source Project: web3j   Source File: JsonRpc2_0Besu.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Request<?, PrivFindPrivacyGroup> privFindPrivacyGroup(
        final List<Base64String> addresses) {
    return new Request<>(
            "priv_findPrivacyGroup",
            Collections.singletonList(addresses),
            web3jService,
            PrivFindPrivacyGroup.class);
}
 
Example 26
Source Project: besu   Source File: AddToOnChainPrivacyGroupTransaction.java    License: Apache License 2.0 5 votes vote down vote up
public AddToOnChainPrivacyGroupTransaction(
    final String privacyGroupId, final PrivacyNode adder, final PrivacyNode... nodes) {
  this.privacyGroupId = Base64String.wrap(privacyGroupId);
  this.adder = adder;
  this.addresses =
      Arrays.stream(nodes)
          .map(n -> n.getOrion().getDefaultPublicKey())
          .collect(Collectors.toList());
}
 
Example 27
Source Project: besu   Source File: CreatePrivacyGroupTransaction.java    License: Apache License 2.0 5 votes vote down vote up
public CreatePrivacyGroupTransaction(
    final String name, final String description, final PrivacyNode... nodes) {
  this.name = name;
  this.description = description;
  this.addresses =
      Arrays.stream(nodes)
          .map(n -> Base64String.wrap(n.getOrion().getDefaultPublicKey()))
          .collect(Collectors.toList());
}
 
Example 28
public CallOnChainPermissioningPrivateSmartContractFunction(
    final String contractAddress,
    final String encodedFunction,
    final String transactionSigningKey,
    final long chainId,
    final String privateFrom,
    final String privacyGroupId) {

  this.contractAddress = contractAddress;
  this.encodedFunction = encodedFunction;
  this.senderCredentials = Credentials.create(transactionSigningKey);
  this.chainId = chainId;
  this.privateFrom = Base64String.wrap(privateFrom);
  this.privacyGroupId = Base64String.wrap(privacyGroupId);
}
 
Example 29
public DeployPrivateSmartContractWithPrivacyGroupIdTransaction(
    final Class<T> clazz,
    final String transactionSigningKey,
    final long chainId,
    final String privateFrom,
    final String privacyGroupId) {
  this.clazz = clazz;
  this.senderCredentials = Credentials.create(transactionSigningKey);
  this.chainId = chainId;
  this.privateFrom = Base64String.wrap(privateFrom);
  this.privacyGroupId = Base64String.wrap(privacyGroupId);
}
 
Example 30
Source Project: besu   Source File: LoadPrivateSmartContractTransaction.java    License: Apache License 2.0 5 votes vote down vote up
public LoadPrivateSmartContractTransaction(
    final String contractAddress,
    final Class<T> clazz,
    final String transactionSigningKey,
    final long chainId,
    final String privateFrom,
    final List<String> privateFor) {

  this.contractAddress = contractAddress;
  this.clazz = clazz;
  this.senderCredentials = Credentials.create(transactionSigningKey);
  this.chainId = chainId;
  this.privateFrom = Base64String.wrap(privateFrom);
  this.privateFor = Base64String.wrapList(privateFor);
}