Skip to content

Commit

Permalink
pan-3222-private-tx-evm-breaking
Browse files Browse the repository at this point in the history
Signed-off-by: Ivaylo Kirilov <iikirilov@gmail.com>
  • Loading branch information
iikirilov committed Oct 9, 2019
1 parent 13ae431 commit 5913baf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,29 @@ public void onlyAliceAndBobCanExecuteContract() {
bob.verify(
privateTransactionVerifier.validPrivateTransactionReceipt(
transactionHash, expectedReceipt));

charlie.verify(privateTransactionVerifier.noPrivateTransactionReceipt(transactionHash));

// When Alice executes a contract call in the wrong privacy group the transaction should pass
// but it should return any output
final String transactionHash2 =
alice.execute(
privateContractTransactions.callSmartContract(
eventEmitter.getContractAddress(),
eventEmitter.value().encodeFunctionCall(),
alice.getTransactionSigningKey(),
POW_CHAIN_ID,
alice.getEnclaveKey(),
charlie.getEnclaveKey()));

final PrivateTransactionReceipt expectedReceipt2 =
alice.execute(privacyTransactions.getPrivateTransactionReceipt(transactionHash2));

assertThat(expectedReceipt2.getOutput()).isEqualTo("0x");

charlie.verify(
privateTransactionVerifier.validPrivateTransactionReceipt(
transactionHash2, expectedReceipt2));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DefaultEvmAccount getAccount(final Address address) {
publicAccount.setImmutable(true);
return publicAccount;
}
return null;
return privateAccount;
}

@Override
Expand Down

0 comments on commit 5913baf

Please sign in to comment.