verify private transaction fails if participant is offline (#1924)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Ivaylo Kirilov 5 years ago committed by Usman Saleem
parent bc24fe460c
commit ccb939fb77
  1. 35
      acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java

@ -118,4 +118,39 @@ public class EnclaveErrorAcceptanceTest extends PrivacyAcceptanceTestBase {
alice.verify( alice.verify(
privateTransactionVerifier.internalErrorPrivateTransactionReceipt(transactionHash)); privateTransactionVerifier.internalErrorPrivateTransactionReceipt(transactionHash));
} }
@Test
public void transactionFailsIfPartyIsOffline() {
// Contract address is generated from sender address and transaction nonce
final String contractAddress = "0xebf56429e6500e84442467292183d4d621359838";
final EventEmitter eventEmitter =
alice.execute(
privateContractTransactions.createSmartContract(
EventEmitter.class,
alice.getTransactionSigningKey(),
IBFT2_CHAIN_ID,
alice.getEnclaveKey(),
bob.getEnclaveKey()));
privateContractVerifier
.validPrivateContractDeployed(contractAddress, alice.getAddress().toString())
.verify(eventEmitter);
bob.getOrion().stop();
final Throwable throwable =
catchThrowable(
() ->
alice.execute(
privateContractTransactions.callSmartContract(
eventEmitter.getContractAddress(),
eventEmitter.store(BigInteger.ONE).encodeFunctionCall(),
alice.getTransactionSigningKey(),
IBFT2_CHAIN_ID,
alice.getEnclaveKey(),
bob.getEnclaveKey())));
assertThat(throwable).hasMessageContaining("NodePushingToPeer");
}
} }

Loading…
Cancel
Save