Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAN-3222] Fix private transactions breaking evm #96

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 NOT 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