From 22f6827131850aa7b5c8cf5b967ff84a7f1ea09e Mon Sep 17 00:00:00 2001 From: sollecitom Date: Mon, 19 Feb 2018 12:09:35 +0000 Subject: [PATCH] CORDA-961 - Revert the introduction of GlobalProperties. * Changes to LargeTransactionTests. * Code review changes. * Code review changes. * Code review changes. * Reverted to MAX_FILE_SIZE for Artemis. * reverted max message size for BridgeControlListener inside Node.kt * reverted max message size for BridgeControlListener inside Node.kt * Renamed setNetworkParameters to withNetworkParameters in MockNetwork.kt * Updated to reflect latest state. --- .ci/api-current.txt | 1084 ++++++++++++++++- .../corda/core/internal/GlobalProperties.kt | 14 - .../kotlin/net/corda/core/node/ServiceHub.kt | 3 + .../core/transactions/WireTransaction.kt | 25 +- docs/source/changelog.rst | 8 +- .../node/services/AttachmentLoadingTests.kt | 20 +- .../statemachine/LargeTransactionsTest.kt | 16 +- .../net/corda/node/internal/AbstractNode.kt | 33 +- .../kotlin/net/corda/node/internal/Node.kt | 52 +- .../services/network/NetworkMapClientTest.kt | 2 +- .../services/network/NetworkMapUpdaterTest.kt | 4 +- .../network/NetworkParametersReaderTest.kt | 2 +- .../transactions/MaxTransactionSizeTests.kt | 5 +- .../node/services/vault/VaultQueryTests.kt | 2 +- .../node/services/vault/VaultWithCashTest.kt | 7 +- .../kotlin/net/corda/testing/driver/Driver.kt | 81 +- .../net/corda/testing/node/MockNetwork.kt | 42 +- .../net/corda/testing/node/MockServices.kt | 32 +- .../net/corda/testing/node/NodeTestUtils.kt | 4 - .../testing/node/internal/DriverDSLImpl.kt | 15 +- .../node/internal/InternalMockNetwork.kt | 19 +- .../testing/node/internal/NodeBasedTest.kt | 2 +- .../corda/testing/node/internal/RPCDriver.kt | 8 +- .../net/corda/smoketesting/NodeProcess.kt | 8 +- .../common/internal/ParametersUtilities.kt | 4 +- .../net/corda/verifier/GeneratedLedger.kt | 40 +- .../net/corda/verifier/VerifierDriver.kt | 7 +- 27 files changed, 1361 insertions(+), 178 deletions(-) delete mode 100644 core/src/main/kotlin/net/corda/core/internal/GlobalProperties.kt diff --git a/.ci/api-current.txt b/.ci/api-current.txt index ed57a195a4..1e13bc2081 100644 --- a/.ci/api-current.txt +++ b/.ci/api-current.txt @@ -14,6 +14,14 @@ public void setMessage(String) public void setOriginalExceptionClassName(String) ## +public @interface net.corda.core.CordaInternal +## +public final class net.corda.core.CordaOID extends java.lang.Object + @org.jetbrains.annotations.NotNull public static final String CORDA_PLATFORM = "1.3.6.1.4.1.50530.1" + public static final net.corda.core.CordaOID INSTANCE + @org.jetbrains.annotations.NotNull public static final String R3_ROOT = "1.3.6.1.4.1.50530" + @org.jetbrains.annotations.NotNull public static final String X509_EXTENSION_CORDA_ROLE = "1.3.6.1.4.1.50530.1.1" +## @net.corda.core.serialization.CordaSerializable public class net.corda.core.CordaRuntimeException extends java.lang.RuntimeException implements net.corda.core.CordaThrowable public (String) public (String, String, Throwable) @@ -350,6 +358,8 @@ public final class net.corda.core.contracts.ComponentGroupEnum extends java.lang public final class net.corda.core.contracts.ContractsDSL extends java.lang.Object @org.jetbrains.annotations.NotNull public static final net.corda.core.contracts.CommandWithParties requireSingleCommand(Collection, Class) public static final Object requireThat(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public static final List select(Collection, Class, java.security.PublicKey, net.corda.core.identity.AbstractParty) + @org.jetbrains.annotations.NotNull public static final List select(Collection, Class, Collection, Collection) ## @net.corda.core.serialization.CordaSerializable public interface net.corda.core.contracts.FungibleAsset extends net.corda.core.contracts.OwnableState @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.Amount getAmount() @@ -493,6 +503,7 @@ public final class net.corda.core.contracts.StateAndContract extends java.lang.O public final class net.corda.core.contracts.Structures extends java.lang.Object @org.jetbrains.annotations.NotNull public static final net.corda.core.crypto.SecureHash hash(net.corda.core.contracts.ContractState) @org.jetbrains.annotations.NotNull public static final net.corda.core.contracts.Amount withoutIssuer(net.corda.core.contracts.Amount) + public static final int MAX_ISSUER_REF_SIZE = 512 ## @net.corda.core.serialization.CordaSerializable public abstract class net.corda.core.contracts.TimeWindow extends java.lang.Object public () @@ -618,6 +629,7 @@ public static final class net.corda.core.contracts.UniqueIdentifier$Companion ex @org.jetbrains.annotations.NotNull public abstract String getName() @org.jetbrains.annotations.NotNull public abstract List getRpcFlows() @org.jetbrains.annotations.NotNull public abstract List getSchedulableFlows() + @org.jetbrains.annotations.NotNull public abstract List getSerializationCustomSerializers() @org.jetbrains.annotations.NotNull public abstract List getSerializationWhitelists() @org.jetbrains.annotations.NotNull public abstract List getServiceFlows() @org.jetbrains.annotations.NotNull public abstract List getServices() @@ -1001,8 +1013,10 @@ public final class net.corda.core.crypto.SignatureScheme extends java.lang.Objec ## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.crypto.TransactionSignature extends net.corda.core.crypto.DigitalSignature public (byte[], java.security.PublicKey, net.corda.core.crypto.SignatureMetadata) + public (byte[], java.security.PublicKey, net.corda.core.crypto.SignatureMetadata, net.corda.core.crypto.PartialMerkleTree) public boolean equals(Object) @org.jetbrains.annotations.NotNull public final java.security.PublicKey getBy() + @org.jetbrains.annotations.Nullable public final net.corda.core.crypto.PartialMerkleTree getPartialMerkleTree() @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SignatureMetadata getSignatureMetadata() public int hashCode() public final boolean isValid(net.corda.core.crypto.SecureHash) @@ -1230,6 +1244,8 @@ public abstract class net.corda.core.flows.FlowLogic extends java.lang.Object @co.paralleluniverse.fibers.Suspendable @kotlin.jvm.JvmStatic public static final void sleep(java.time.Duration) @co.paralleluniverse.fibers.Suspendable public Object subFlow(net.corda.core.flows.FlowLogic) @org.jetbrains.annotations.Nullable public final net.corda.core.messaging.DataFeed track() + @org.jetbrains.annotations.Nullable public final net.corda.core.messaging.DataFeed trackStepsTree() + @org.jetbrains.annotations.Nullable public final net.corda.core.messaging.DataFeed trackStepsTreeIndex() @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction waitForLedgerCommit(net.corda.core.crypto.SecureHash) @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.SignedTransaction waitForLedgerCommit(net.corda.core.crypto.SecureHash, boolean) public static final net.corda.core.flows.FlowLogic$Companion Companion @@ -1241,6 +1257,7 @@ public static final class net.corda.core.flows.FlowLogic$Companion extends java. @net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public interface net.corda.core.flows.FlowLogicRef ## @net.corda.core.DoNotImplement public interface net.corda.core.flows.FlowLogicRefFactory + @org.jetbrains.annotations.NotNull public abstract net.corda.core.flows.FlowLogic toFlowLogic(net.corda.core.flows.FlowLogicRef) ## @net.corda.core.DoNotImplement public abstract class net.corda.core.flows.FlowSession extends java.lang.Object public () @@ -1304,9 +1321,30 @@ public @interface net.corda.core.flows.InitiatingFlow public int hashCode() @org.jetbrains.annotations.NotNull public String toString() ## +@net.corda.core.serialization.CordaSerializable public static final class net.corda.core.flows.NotaryError$General extends net.corda.core.flows.NotaryError + public (String) + @org.jetbrains.annotations.NotNull public final String component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.flows.NotaryError$General copy(String) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final String getCause() + public int hashCode() + @org.jetbrains.annotations.NotNull public String toString() +## @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.flows.NotaryError$TimeWindowInvalid extends net.corda.core.flows.NotaryError + public (java.time.Instant, net.corda.core.contracts.TimeWindow) + @org.jetbrains.annotations.NotNull public final java.time.Instant component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.TimeWindow component2() + @org.jetbrains.annotations.NotNull public final net.corda.core.flows.NotaryError$TimeWindowInvalid copy(java.time.Instant, net.corda.core.contracts.TimeWindow) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final java.time.Instant getCurrentTime() + @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.TimeWindow getTxTimeWindow() + public int hashCode() + @org.jetbrains.annotations.NotNull public String toString() + public static final net.corda.core.flows.NotaryError$TimeWindowInvalid$Companion Companion @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.flows.NotaryError$TimeWindowInvalid INSTANCE ## +public static final class net.corda.core.flows.NotaryError$TimeWindowInvalid$Companion extends java.lang.Object +## @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.flows.NotaryError$TransactionInvalid extends net.corda.core.flows.NotaryError public (Throwable) @org.jetbrains.annotations.NotNull public final Throwable component1() @@ -1522,6 +1560,7 @@ public final class net.corda.core.identity.IdentityUtils extends java.lang.Objec @net.corda.core.serialization.CordaSerializable public interface net.corda.core.messaging.AllPossibleRecipients extends net.corda.core.messaging.MessageRecipients ## @net.corda.core.DoNotImplement public interface net.corda.core.messaging.CordaRPCOps extends net.corda.core.messaging.RPCOps + public abstract void acceptNewNetworkParameters(net.corda.core.crypto.SecureHash) public abstract void addVaultTransactionNote(net.corda.core.crypto.SecureHash, String) public abstract boolean attachmentExists(net.corda.core.crypto.SecureHash) public abstract void clearNetworkMapCache() @@ -1530,8 +1569,10 @@ public final class net.corda.core.identity.IdentityUtils extends java.lang.Objec @org.jetbrains.annotations.NotNull public abstract Iterable getVaultTransactionNotes(net.corda.core.crypto.SecureHash) @kotlin.Deprecated @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed internalVerifiedTransactionsFeed() @kotlin.Deprecated @org.jetbrains.annotations.NotNull public abstract List internalVerifiedTransactionsSnapshot() + public abstract boolean isFlowsDrainingModeEnabled() @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed networkMapFeed() @org.jetbrains.annotations.NotNull public abstract List networkMapSnapshot() + @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed networkParametersFeed() @org.jetbrains.annotations.NotNull public abstract net.corda.core.node.NodeInfo nodeInfo() @org.jetbrains.annotations.Nullable public abstract net.corda.core.node.NodeInfo nodeInfoFromParty(net.corda.core.identity.AbstractParty) @org.jetbrains.annotations.NotNull public abstract List notaryIdentities() @@ -1541,6 +1582,7 @@ public final class net.corda.core.identity.IdentityUtils extends java.lang.Objec @org.jetbrains.annotations.Nullable public abstract net.corda.core.identity.Party partyFromKey(java.security.PublicKey) @org.jetbrains.annotations.NotNull public abstract List queryAttachments(net.corda.core.node.services.vault.AttachmentQueryCriteria, net.corda.core.node.services.vault.AttachmentSort) @org.jetbrains.annotations.NotNull public abstract List registeredFlows() + public abstract void setFlowsDrainingModeEnabled(boolean) @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed stateMachineRecordedTransactionMappingFeed() @org.jetbrains.annotations.NotNull public abstract List stateMachineRecordedTransactionMappingSnapshot() @net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed stateMachinesFeed() @@ -1594,18 +1636,27 @@ public final class net.corda.core.messaging.CordaRPCOpsKt extends java.lang.Obje @net.corda.core.DoNotImplement public interface net.corda.core.messaging.FlowProgressHandle extends net.corda.core.messaging.FlowHandle public abstract void close() @org.jetbrains.annotations.NotNull public abstract rx.Observable getProgress() + @org.jetbrains.annotations.Nullable public abstract net.corda.core.messaging.DataFeed getStepsTreeFeed() + @org.jetbrains.annotations.Nullable public abstract net.corda.core.messaging.DataFeed getStepsTreeIndexFeed() ## @net.corda.core.serialization.CordaSerializable @net.corda.core.DoNotImplement public final class net.corda.core.messaging.FlowProgressHandleImpl extends java.lang.Object implements net.corda.core.messaging.FlowProgressHandle public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable) + public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable, net.corda.core.messaging.DataFeed) + public (net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable, net.corda.core.messaging.DataFeed, net.corda.core.messaging.DataFeed) public void close() @org.jetbrains.annotations.NotNull public final net.corda.core.flows.StateMachineRunId component1() @org.jetbrains.annotations.NotNull public final net.corda.core.concurrent.CordaFuture component2() @org.jetbrains.annotations.NotNull public final rx.Observable component3() + @org.jetbrains.annotations.Nullable public final net.corda.core.messaging.DataFeed component4() + @org.jetbrains.annotations.Nullable public final net.corda.core.messaging.DataFeed component5() @org.jetbrains.annotations.NotNull public final net.corda.core.messaging.FlowProgressHandleImpl copy(net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable) + @org.jetbrains.annotations.NotNull public final net.corda.core.messaging.FlowProgressHandleImpl copy(net.corda.core.flows.StateMachineRunId, net.corda.core.concurrent.CordaFuture, rx.Observable, net.corda.core.messaging.DataFeed, net.corda.core.messaging.DataFeed) public boolean equals(Object) @org.jetbrains.annotations.NotNull public net.corda.core.flows.StateMachineRunId getId() @org.jetbrains.annotations.NotNull public rx.Observable getProgress() @org.jetbrains.annotations.NotNull public net.corda.core.concurrent.CordaFuture getReturnValue() + @org.jetbrains.annotations.Nullable public net.corda.core.messaging.DataFeed getStepsTreeFeed() + @org.jetbrains.annotations.Nullable public net.corda.core.messaging.DataFeed getStepsTreeIndexFeed() public int hashCode() public String toString() ## @@ -1613,6 +1664,21 @@ public final class net.corda.core.messaging.CordaRPCOpsKt extends java.lang.Obje ## @net.corda.core.serialization.CordaSerializable public interface net.corda.core.messaging.MessageRecipients ## +@net.corda.core.serialization.CordaSerializable public final class net.corda.core.messaging.ParametersUpdateInfo extends java.lang.Object + public (net.corda.core.crypto.SecureHash, net.corda.core.node.NetworkParameters, String, java.time.Instant) + @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters component2() + @org.jetbrains.annotations.NotNull public final String component3() + @org.jetbrains.annotations.NotNull public final java.time.Instant component4() + @org.jetbrains.annotations.NotNull public final net.corda.core.messaging.ParametersUpdateInfo copy(net.corda.core.crypto.SecureHash, net.corda.core.node.NetworkParameters, String, java.time.Instant) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final String getDescription() + @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.SecureHash getHash() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters getParameters() + @org.jetbrains.annotations.NotNull public final java.time.Instant getUpdateDeadline() + public int hashCode() + public String toString() +## @net.corda.core.DoNotImplement public interface net.corda.core.messaging.RPCOps public abstract int getProtocolVersion() ## @@ -1678,6 +1744,25 @@ public @interface net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.FlowHandle startFlow(net.corda.core.flows.FlowLogic) @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.FlowProgressHandle startTrackedFlow(net.corda.core.flows.FlowLogic) ## +@net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.NetworkParameters extends java.lang.Object + public (int, List, int, int, java.time.Instant, int) + public final int component1() + @org.jetbrains.annotations.NotNull public final List component2() + public final int component3() + public final int component4() + @org.jetbrains.annotations.NotNull public final java.time.Instant component5() + public final int component6() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters copy(int, List, int, int, java.time.Instant, int) + public boolean equals(Object) + public final int getEpoch() + public final int getMaxMessageSize() + public final int getMaxTransactionSize() + public final int getMinimumPlatformVersion() + @org.jetbrains.annotations.NotNull public final java.time.Instant getModifiedTime() + @org.jetbrains.annotations.NotNull public final List getNotaries() + public int hashCode() + public String toString() +## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.NodeInfo extends java.lang.Object public (List, List, int, long) @org.jetbrains.annotations.NotNull public final List component1() @@ -1692,10 +1777,22 @@ public @interface net.corda.core.messaging.RPCReturnsObservables public final int getPlatformVersion() public final long getSerial() public int hashCode() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.PartyAndCertificate identityAndCertFromX500Name(net.corda.core.identity.CordaX500Name) @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party identityFromX500Name(net.corda.core.identity.CordaX500Name) public final boolean isLegalIdentity(net.corda.core.identity.Party) public String toString() ## +@net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.NotaryInfo extends java.lang.Object + public (net.corda.core.identity.Party, boolean) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party component1() + public final boolean component2() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NotaryInfo copy(net.corda.core.identity.Party, boolean) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getIdentity() + public final boolean getValidating() + public int hashCode() + public String toString() +## @net.corda.core.DoNotImplement public interface net.corda.core.node.ServiceHub extends net.corda.core.node.ServicesForResolution @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction) @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction, java.security.PublicKey) @@ -1716,6 +1813,7 @@ public @interface net.corda.core.messaging.RPCReturnsObservables public abstract void recordTransactions(Iterable) public abstract void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) public abstract void recordTransactions(boolean, Iterable) + public abstract void registerUnloadHandler(kotlin.jvm.functions.Function0) @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder) @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, Iterable) @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, java.security.PublicKey) @@ -1725,9 +1823,11 @@ public @interface net.corda.core.messaging.RPCReturnsObservables @org.jetbrains.annotations.NotNull public abstract net.corda.core.node.services.AttachmentStorage getAttachments() @org.jetbrains.annotations.NotNull public abstract net.corda.core.cordapp.CordappProvider getCordappProvider() @org.jetbrains.annotations.NotNull public abstract net.corda.core.node.services.IdentityService getIdentityService() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.node.NetworkParameters getNetworkParameters() ## @net.corda.core.DoNotImplement public interface net.corda.core.node.StateLoader @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) + @org.jetbrains.annotations.NotNull public abstract Set loadStates(Set) ## public final class net.corda.core.node.StatesToRecord extends java.lang.Enum protected (String, int) @@ -1735,8 +1835,10 @@ public final class net.corda.core.node.StatesToRecord extends java.lang.Enum public static net.corda.core.node.StatesToRecord[] values() ## @net.corda.core.DoNotImplement public interface net.corda.core.node.services.AttachmentStorage + public abstract boolean hasAttachment(net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public abstract net.corda.core.crypto.SecureHash importAttachment(java.io.InputStream) @org.jetbrains.annotations.NotNull public abstract net.corda.core.crypto.SecureHash importAttachment(java.io.InputStream, String, String) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.crypto.SecureHash importOrGetAttachment(java.io.InputStream) @org.jetbrains.annotations.Nullable public abstract net.corda.core.contracts.Attachment openAttachment(net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public abstract List queryAttachments(net.corda.core.node.services.vault.AttachmentQueryCriteria, net.corda.core.node.services.vault.AttachmentSort) ## @@ -1832,11 +1934,13 @@ public @interface net.corda.core.node.services.CordaService @org.jetbrains.annotations.NotNull public abstract net.corda.core.node.ServiceHub getServices() public abstract void start() public abstract void stop() + @kotlin.jvm.JvmStatic public static final void validateTimeWindow(java.time.Clock, net.corda.core.contracts.TimeWindow) public static final net.corda.core.node.services.NotaryService$Companion Companion @org.jetbrains.annotations.NotNull public static final String ID_PREFIX = "corda.notary." ## public static final class net.corda.core.node.services.NotaryService$Companion extends java.lang.Object @kotlin.Deprecated @org.jetbrains.annotations.NotNull public final String constructId(boolean, boolean, boolean, boolean) + @kotlin.jvm.JvmStatic public final void validateTimeWindow(java.time.Clock, net.corda.core.contracts.TimeWindow) ## public abstract class net.corda.core.node.services.PartyInfo extends java.lang.Object @org.jetbrains.annotations.NotNull public abstract net.corda.core.identity.Party getParty() @@ -1876,6 +1980,7 @@ public final class net.corda.core.node.services.TimeWindowChecker extends java.l @net.corda.core.DoNotImplement public interface net.corda.core.node.services.TransactionStorage extends net.corda.core.node.StateLoader @org.jetbrains.annotations.Nullable public abstract net.corda.core.transactions.SignedTransaction getTransaction(net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public abstract rx.Observable getUpdates() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.DataFeed track() ## @net.corda.core.DoNotImplement public interface net.corda.core.node.services.TransactionVerifierService @@ -1890,6 +1995,9 @@ public final class net.corda.core.node.services.TimeWindowChecker extends java.l @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.TransactionSignature sign(net.corda.core.crypto.SecureHash) @org.jetbrains.annotations.NotNull public final net.corda.core.crypto.DigitalSignature$WithKey sign(byte[]) public final void validateTimeWindow(net.corda.core.contracts.TimeWindow) + public static final net.corda.core.node.services.TrustedAuthorityNotaryService$Companion Companion +## +public static final class net.corda.core.node.services.TrustedAuthorityNotaryService$Companion extends java.lang.Object ## @net.corda.core.serialization.CordaSerializable public final class net.corda.core.node.services.UniquenessException extends net.corda.core.CordaException public (net.corda.core.node.services.UniquenessProvider$Conflict) @@ -2609,6 +2717,7 @@ public final class net.corda.core.schemas.CommonSchemaV1 extends net.corda.core. public static final net.corda.core.schemas.CommonSchemaV1 INSTANCE ## @javax.persistence.MappedSuperclass @net.corda.core.serialization.CordaSerializable public static class net.corda.core.schemas.CommonSchemaV1$FungibleState extends net.corda.core.schemas.PersistentState + public () public (Set, net.corda.core.identity.AbstractParty, long, net.corda.core.identity.AbstractParty, byte[]) @org.jetbrains.annotations.NotNull public final net.corda.core.identity.AbstractParty getIssuer() @org.jetbrains.annotations.NotNull public final byte[] getIssuerRef() @@ -2622,6 +2731,7 @@ public final class net.corda.core.schemas.CommonSchemaV1 extends net.corda.core. public final void setQuantity(long) ## @javax.persistence.MappedSuperclass @net.corda.core.serialization.CordaSerializable public static class net.corda.core.schemas.CommonSchemaV1$LinearState extends net.corda.core.schemas.PersistentState + public () public (Set, String, UUID) public (net.corda.core.contracts.UniqueIdentifier, Set) @org.jetbrains.annotations.Nullable public final String getExternalId() @@ -3074,7 +3184,7 @@ public class net.corda.core.transactions.TransactionBuilder extends java.lang.Ob @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.PrivacySalt getPrivacySalt() @org.jetbrains.annotations.NotNull public final Set getRequiredSigningKeys() public int hashCode() - @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.LedgerTransaction toLedgerTransaction(kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + @kotlin.Deprecated @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.LedgerTransaction toLedgerTransaction(kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.LedgerTransaction toLedgerTransaction(net.corda.core.node.ServicesForResolution) @org.jetbrains.annotations.NotNull public String toString() public static final net.corda.core.transactions.WireTransaction$Companion Companion @@ -3145,6 +3255,7 @@ public static final class net.corda.core.utilities.Id$Companion extends java.lan @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.Id newInstance(Object, String, java.time.Instant) ## public final class net.corda.core.utilities.KotlinUtilsKt extends java.lang.Object + @org.jetbrains.annotations.NotNull public static final org.slf4j.Logger contextLogger(Object) public static final void debug(org.slf4j.Logger, kotlin.jvm.functions.Function0) public static final int exactAdd(int, int) public static final long exactAdd(long, long) @@ -3230,6 +3341,7 @@ public static final class net.corda.core.utilities.OpaqueBytes$Companion extends @net.corda.core.serialization.CordaSerializable public final class net.corda.core.utilities.ProgressTracker extends java.lang.Object public final void endWithError(Throwable) @org.jetbrains.annotations.NotNull public final List getAllSteps() + @org.jetbrains.annotations.NotNull public final List getAllStepsLabels() @org.jetbrains.annotations.NotNull public final rx.Observable getChanges() @org.jetbrains.annotations.Nullable public final net.corda.core.utilities.ProgressTracker getChildProgressTracker(net.corda.core.utilities.ProgressTracker$Step) @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.ProgressTracker$Step getCurrentStep() @@ -3238,12 +3350,16 @@ public static final class net.corda.core.utilities.OpaqueBytes$Companion extends @org.jetbrains.annotations.Nullable public final net.corda.core.utilities.ProgressTracker getParent() public final int getStepIndex() @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.ProgressTracker$Step[] getSteps() + @org.jetbrains.annotations.NotNull public final rx.Observable getStepsTreeChanges() + public final int getStepsTreeIndex() + @org.jetbrains.annotations.NotNull public final rx.Observable getStepsTreeIndexChanges() @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.ProgressTracker getTopLevelTracker() @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.ProgressTracker$Step nextStep() public final void setChildProgressTracker(net.corda.core.utilities.ProgressTracker$Step, net.corda.core.utilities.ProgressTracker) public final void setCurrentStep(net.corda.core.utilities.ProgressTracker$Step) ## @net.corda.core.serialization.CordaSerializable public abstract static class net.corda.core.utilities.ProgressTracker$Change extends java.lang.Object + @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.ProgressTracker getProgressTracker() ## @net.corda.core.serialization.CordaSerializable public static final class net.corda.core.utilities.ProgressTracker$Change$Position extends net.corda.core.utilities.ProgressTracker$Change public (net.corda.core.utilities.ProgressTracker, net.corda.core.utilities.ProgressTracker$Step) @@ -3522,15 +3638,546 @@ public static final class net.corda.client.jackson.StringToMethodCallParser$Unpa public (String) @org.jetbrains.annotations.NotNull public final String getMethodName() ## +public final class net.corda.testing.driver.Driver extends java.lang.Object + public static final Object driver(net.corda.testing.driver.DriverParameters, kotlin.jvm.functions.Function1) +## +@net.corda.core.DoNotImplement public interface net.corda.testing.driver.DriverDSL + @org.jetbrains.annotations.NotNull public abstract java.nio.file.Path baseDirectory(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.driver.NotaryHandle getDefaultNotaryHandle() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.identity.Party getDefaultNotaryIdentity() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.concurrent.CordaFuture getDefaultNotaryNode() + @org.jetbrains.annotations.NotNull public abstract List getNotaryHandles() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.concurrent.CordaFuture startNode(net.corda.testing.driver.NodeParameters) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.concurrent.CordaFuture startNode(net.corda.testing.driver.NodeParameters, net.corda.core.identity.CordaX500Name, List, net.corda.node.services.config.VerifierType, Map, Boolean, String) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.concurrent.CordaFuture startWebserver(net.corda.testing.driver.NodeHandle) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.concurrent.CordaFuture startWebserver(net.corda.testing.driver.NodeHandle, String) +## +public final class net.corda.testing.driver.DriverParameters extends java.lang.Object + public () + public (boolean, java.nio.file.Path, net.corda.testing.driver.PortAllocation, net.corda.testing.driver.PortAllocation, Map, boolean, boolean, boolean, boolean, List, List, net.corda.testing.driver.JmxPolicy, net.corda.core.node.NetworkParameters) + public final boolean component1() + @org.jetbrains.annotations.NotNull public final List component10() + @org.jetbrains.annotations.NotNull public final List component11() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.JmxPolicy component12() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters component13() + @org.jetbrains.annotations.NotNull public final java.nio.file.Path component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.PortAllocation component3() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.PortAllocation component4() + @org.jetbrains.annotations.NotNull public final Map component5() + public final boolean component6() + public final boolean component7() + public final boolean component8() + public final boolean component9() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters copy(boolean, java.nio.file.Path, net.corda.testing.driver.PortAllocation, net.corda.testing.driver.PortAllocation, Map, boolean, boolean, boolean, boolean, List, List, net.corda.testing.driver.JmxPolicy, net.corda.core.node.NetworkParameters) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.PortAllocation getDebugPortAllocation() + @org.jetbrains.annotations.NotNull public final java.nio.file.Path getDriverDirectory() + @org.jetbrains.annotations.NotNull public final List getExtraCordappPackagesToScan() + public final boolean getInitialiseSerialization() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.JmxPolicy getJmxPolicy() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters getNetworkParameters() + @org.jetbrains.annotations.NotNull public final List getNotarySpecs() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.PortAllocation getPortAllocation() + public final boolean getStartNodesInProcess() + @org.jetbrains.annotations.NotNull public final Map getSystemProperties() + public final boolean getUseTestClock() + public final boolean getWaitForAllNodesToFinish() + public int hashCode() + public final boolean isDebug() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setDebugPortAllocation(net.corda.testing.driver.PortAllocation) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setDriverDirectory(java.nio.file.Path) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setExtraCordappPackagesToScan(List) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setInitialiseSerialization(boolean) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setIsDebug(boolean) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setJmxPolicy(net.corda.testing.driver.JmxPolicy) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setNetworkParameters(net.corda.core.node.NetworkParameters) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setNotarySpecs(List) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setPortAllocation(net.corda.testing.driver.PortAllocation) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setStartNodesInProcess(boolean) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setSystemProperties(Map) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setUseTestClock(boolean) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.DriverParameters setWaitForAllNodesToFinish(boolean) + public String toString() +## +@net.corda.core.DoNotImplement public interface net.corda.testing.driver.InProcess extends net.corda.testing.driver.NodeHandle + @org.jetbrains.annotations.NotNull public abstract net.corda.node.services.api.StartedNodeServices getServices() + @org.jetbrains.annotations.NotNull public abstract rx.Observable registerInitiatedFlow(Class) +## +public final class net.corda.testing.driver.JmxPolicy extends java.lang.Object + public () + public (boolean, net.corda.testing.driver.PortAllocation) + public final boolean component1() + @org.jetbrains.annotations.Nullable public final net.corda.testing.driver.PortAllocation component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.JmxPolicy copy(boolean, net.corda.testing.driver.PortAllocation) + public boolean equals(Object) + @org.jetbrains.annotations.Nullable public final net.corda.testing.driver.PortAllocation getJmxHttpServerPortAllocation() + public final boolean getStartJmxHttpServer() + public int hashCode() + public String toString() +## +@net.corda.core.DoNotImplement public interface net.corda.testing.driver.NodeHandle extends java.lang.AutoCloseable + @org.jetbrains.annotations.NotNull public abstract java.nio.file.Path getBaseDirectory() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.node.NodeInfo getNodeInfo() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.utilities.NetworkHostAndPort getP2pAddress() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.messaging.CordaRPCOps getRpc() + @org.jetbrains.annotations.NotNull public abstract net.corda.core.utilities.NetworkHostAndPort getRpcAddress() + @org.jetbrains.annotations.NotNull public abstract List getRpcUsers() + public abstract void stop() +## +public final class net.corda.testing.driver.NodeParameters extends java.lang.Object + public () + public (net.corda.core.identity.CordaX500Name, List, net.corda.node.services.config.VerifierType, Map, Boolean, String) + @org.jetbrains.annotations.Nullable public final net.corda.core.identity.CordaX500Name component1() + @org.jetbrains.annotations.NotNull public final List component2() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.config.VerifierType component3() + @org.jetbrains.annotations.NotNull public final Map component4() + @org.jetbrains.annotations.Nullable public final Boolean component5() + @org.jetbrains.annotations.NotNull public final String component6() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters copy(net.corda.core.identity.CordaX500Name, List, net.corda.node.services.config.VerifierType, Map, Boolean, String) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final Map getCustomOverrides() + @org.jetbrains.annotations.NotNull public final String getMaximumHeapSize() + @org.jetbrains.annotations.Nullable public final net.corda.core.identity.CordaX500Name getProvidedName() + @org.jetbrains.annotations.NotNull public final List getRpcUsers() + @org.jetbrains.annotations.Nullable public final Boolean getStartInSameProcess() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.config.VerifierType getVerifierType() + public int hashCode() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters setCustomerOverrides(Map) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters setMaximumHeapSize(String) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters setProvidedName(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters setRpcUsers(List) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters setStartInSameProcess(Boolean) + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NodeParameters setVerifierType(net.corda.node.services.config.VerifierType) + public String toString() +## +public final class net.corda.testing.driver.NotaryHandle extends java.lang.Object + public (net.corda.core.identity.Party, boolean, net.corda.core.concurrent.CordaFuture) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party component1() + public final boolean component2() + @org.jetbrains.annotations.NotNull public final net.corda.core.concurrent.CordaFuture component3() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.NotaryHandle copy(net.corda.core.identity.Party, boolean, net.corda.core.concurrent.CordaFuture) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getIdentity() + @org.jetbrains.annotations.NotNull public final net.corda.core.concurrent.CordaFuture getNodeHandles() + public final boolean getValidating() + public int hashCode() + public String toString() +## +@net.corda.core.DoNotImplement public interface net.corda.testing.driver.OutOfProcess extends net.corda.testing.driver.NodeHandle + @org.jetbrains.annotations.NotNull public abstract Process getProcess() +## +@net.corda.core.DoNotImplement public abstract class net.corda.testing.driver.PortAllocation extends java.lang.Object + @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NetworkHostAndPort nextHostAndPort() + public abstract int nextPort() +## +public static final class net.corda.testing.driver.PortAllocation$Incremental extends net.corda.testing.driver.PortAllocation + public (int) + @org.jetbrains.annotations.NotNull public final concurrent.atomic.AtomicInteger getPortCounter() + public int nextPort() +## +public static final class net.corda.testing.driver.PortAllocation$RandomFree extends net.corda.testing.driver.PortAllocation + public int nextPort() + public static final net.corda.testing.driver.PortAllocation$RandomFree INSTANCE +## +public final class net.corda.testing.driver.WebserverHandle extends java.lang.Object + public (net.corda.core.utilities.NetworkHostAndPort, Process) + @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NetworkHostAndPort component1() + @org.jetbrains.annotations.NotNull public final Process component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.driver.WebserverHandle copy(net.corda.core.utilities.NetworkHostAndPort, Process) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.NetworkHostAndPort getListenAddress() + @org.jetbrains.annotations.NotNull public final Process getProcess() + public int hashCode() + public String toString() +## +@net.corda.core.DoNotImplement public abstract class net.corda.testing.node.ClusterSpec extends java.lang.Object + public () + public abstract int getClusterSize() +## +public static final class net.corda.testing.node.ClusterSpec$Raft extends net.corda.testing.node.ClusterSpec + public (int) + public final int component1() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.ClusterSpec$Raft copy(int) + public boolean equals(Object) + public int getClusterSize() + public int hashCode() + public String toString() +## +@javax.annotation.concurrent.ThreadSafe public final class net.corda.testing.node.InMemoryMessagingNetwork extends net.corda.core.serialization.SingletonSerializeAsToken + @org.jetbrains.annotations.NotNull public synchronized final List getEndpoints() + @org.jetbrains.annotations.NotNull public final rx.Observable getReceivedMessages() + @org.jetbrains.annotations.NotNull public final rx.Observable getSentMessages() + @org.jetbrains.annotations.Nullable public final net.corda.testing.node.InMemoryMessagingNetwork$MessageTransfer pumpSend(boolean) + public final void stop() + public static final net.corda.testing.node.InMemoryMessagingNetwork$Companion Companion +## +public static final class net.corda.testing.node.InMemoryMessagingNetwork$Companion extends java.lang.Object +## +public static final class net.corda.testing.node.InMemoryMessagingNetwork$InMemoryMessage extends java.lang.Object implements net.corda.node.services.messaging.Message + public (String, net.corda.core.utilities.ByteSequence, String, java.time.Instant) + @org.jetbrains.annotations.NotNull public final String component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.utilities.ByteSequence component2() + @org.jetbrains.annotations.NotNull public final String component3() + @org.jetbrains.annotations.NotNull public final java.time.Instant component4() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$InMemoryMessage copy(String, net.corda.core.utilities.ByteSequence, String, java.time.Instant) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public net.corda.core.utilities.ByteSequence getData() + @org.jetbrains.annotations.NotNull public java.time.Instant getDebugTimestamp() + @org.jetbrains.annotations.NotNull public String getTopic() + @org.jetbrains.annotations.NotNull public String getUniqueMessageId() + public int hashCode() + @org.jetbrains.annotations.NotNull public String toString() +## +public final class net.corda.testing.node.InMemoryMessagingNetwork$InMemoryMessaging$Handler extends java.lang.Object implements net.corda.node.services.messaging.MessageHandlerRegistration + public (net.corda.testing.node.InMemoryMessagingNetwork$InMemoryMessaging, String, kotlin.jvm.functions.Function2) + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function2 getCallback() + @org.jetbrains.annotations.NotNull public final String getTopicSession() +## public static interface net.corda.testing.node.InMemoryMessagingNetwork$LatencyCalculator @org.jetbrains.annotations.NotNull public abstract java.time.Duration between(net.corda.core.messaging.SingleMessageRecipient, net.corda.core.messaging.SingleMessageRecipient) ## +@net.corda.core.serialization.CordaSerializable public static final class net.corda.testing.node.InMemoryMessagingNetwork$MessageTransfer extends java.lang.Object + public (net.corda.testing.node.InMemoryMessagingNetwork$PeerHandle, net.corda.node.services.messaging.Message, net.corda.core.messaging.MessageRecipients) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$PeerHandle component1() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.messaging.Message component2() + @org.jetbrains.annotations.NotNull public final net.corda.core.messaging.MessageRecipients component3() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$MessageTransfer copy(net.corda.testing.node.InMemoryMessagingNetwork$PeerHandle, net.corda.node.services.messaging.Message, net.corda.core.messaging.MessageRecipients) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.node.services.messaging.Message getMessage() + @org.jetbrains.annotations.NotNull public final net.corda.core.messaging.MessageRecipients getRecipients() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$PeerHandle getSender() + public int hashCode() + @org.jetbrains.annotations.NotNull public String toString() +## +@net.corda.core.serialization.CordaSerializable public static final class net.corda.testing.node.InMemoryMessagingNetwork$PeerHandle extends java.lang.Object implements net.corda.core.messaging.SingleMessageRecipient + public (int, net.corda.core.identity.CordaX500Name) + public final int component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$PeerHandle copy(int, net.corda.core.identity.CordaX500Name) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name getDescription() + public final int getId() + public int hashCode() + @org.jetbrains.annotations.NotNull public String toString() +## +@net.corda.core.serialization.CordaSerializable public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServiceHandle extends java.lang.Object implements net.corda.core.messaging.MessageRecipientGroup + public (net.corda.core.identity.Party) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party component1() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$ServiceHandle copy(net.corda.core.identity.Party) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getParty() + public int hashCode() + @org.jetbrains.annotations.NotNull public String toString() +## +@net.corda.core.DoNotImplement public abstract static class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy extends java.lang.Object + public abstract Object pickNext(net.corda.testing.node.InMemoryMessagingNetwork$ServiceHandle, List) +## +public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy$Random extends net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy + public () + public (SplittableRandom) + @org.jetbrains.annotations.NotNull public final SplittableRandom getRandom() + public Object pickNext(net.corda.testing.node.InMemoryMessagingNetwork$ServiceHandle, List) +## +public static final class net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy$RoundRobin extends net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy + public () + public Object pickNext(net.corda.testing.node.InMemoryMessagingNetwork$ServiceHandle, List) +## +@net.corda.core.DoNotImplement public static interface net.corda.testing.node.InMemoryMessagingNetwork$TestMessagingService extends net.corda.node.services.messaging.MessagingService + @org.jetbrains.annotations.Nullable public abstract net.corda.testing.node.InMemoryMessagingNetwork$MessageTransfer pumpReceive(boolean) + public abstract void stop() +## +public class net.corda.testing.node.MessagingServiceSpy extends java.lang.Object implements net.corda.node.services.messaging.MessagingService + public (net.corda.node.services.messaging.MessagingService) + @org.jetbrains.annotations.NotNull public net.corda.node.services.messaging.MessageHandlerRegistration addMessageHandler(String, kotlin.jvm.functions.Function2) + public void cancelRedelivery(long) + @org.jetbrains.annotations.NotNull public net.corda.node.services.messaging.Message createMessage(String, byte[], String) + @org.jetbrains.annotations.NotNull public net.corda.core.messaging.MessageRecipients getAddressOfParty(net.corda.core.node.services.PartyInfo) + @org.jetbrains.annotations.NotNull public final net.corda.node.services.messaging.MessagingService getMessagingService() + @org.jetbrains.annotations.NotNull public net.corda.core.messaging.SingleMessageRecipient getMyAddress() + public void removeMessageHandler(net.corda.node.services.messaging.MessageHandlerRegistration) + @co.paralleluniverse.fibers.Suspendable public void send(List) + @co.paralleluniverse.fibers.Suspendable public void send(net.corda.node.services.messaging.Message, net.corda.core.messaging.MessageRecipients, Long, Object, Map) +## +public final class net.corda.testing.node.MockKeyManagementService extends net.corda.core.serialization.SingletonSerializeAsToken implements net.corda.core.node.services.KeyManagementService + @org.jetbrains.annotations.NotNull public Iterable filterMyKeys(Iterable) + @org.jetbrains.annotations.NotNull public java.security.PublicKey freshKey() + @org.jetbrains.annotations.NotNull public net.corda.core.identity.PartyAndCertificate freshKeyAndCert(net.corda.core.identity.PartyAndCertificate, boolean) + @org.jetbrains.annotations.NotNull public final net.corda.core.node.services.IdentityService getIdentityService() + @org.jetbrains.annotations.NotNull public Set getKeys() + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature sign(net.corda.core.crypto.SignableData, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.DigitalSignature$WithKey sign(byte[], java.security.PublicKey) +## +public class net.corda.testing.node.MockNetwork extends java.lang.Object + public (List) + public (List, net.corda.testing.node.MockNetworkParameters) + public (List, net.corda.testing.node.MockNetworkParameters, boolean, boolean, net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy, List, net.corda.core.node.NetworkParameters) + @org.jetbrains.annotations.NotNull public final java.nio.file.Path baseDirectory(int) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode(net.corda.core.identity.CordaX500Name, Integer) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode(net.corda.core.identity.CordaX500Name, Integer, java.math.BigInteger) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode(net.corda.core.identity.CordaX500Name, Integer, java.math.BigInteger, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode(net.corda.core.identity.CordaX500Name, Integer, java.math.BigInteger, kotlin.jvm.functions.Function1, net.corda.node.VersionInfo) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createNode(net.corda.testing.node.MockNodeParameters) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode createPartyNode(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode(net.corda.core.identity.CordaX500Name, Integer) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode(net.corda.core.identity.CordaX500Name, Integer, java.math.BigInteger) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode(net.corda.core.identity.CordaX500Name, Integer, java.math.BigInteger, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode(net.corda.core.identity.CordaX500Name, Integer, java.math.BigInteger, kotlin.jvm.functions.Function1, net.corda.node.VersionInfo) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.UnstartedMockNode createUnstartedNode(net.corda.testing.node.MockNodeParameters) + @org.jetbrains.annotations.NotNull public final List getCordappPackages() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getDefaultNotaryIdentity() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode getDefaultNotaryNode() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters getDefaultParameters() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters getNetworkParameters() + public final boolean getNetworkSendManuallyPumped() + public final int getNextNodeId() + @org.jetbrains.annotations.NotNull public final List getNotaryNodes() + @org.jetbrains.annotations.NotNull public final List getNotarySpecs() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy getServicePeerAllocationStrategy() + public final boolean getThreadPerNode() + public final void runNetwork() + public final void runNetwork(int) + public final void startNodes() + public final void stopNodes() + public final void waitQuiescent() +## +public final class net.corda.testing.node.MockNetworkNotarySpec extends java.lang.Object + public (net.corda.core.identity.CordaX500Name) + public (net.corda.core.identity.CordaX500Name, boolean) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name component1() + public final boolean component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkNotarySpec copy(net.corda.core.identity.CordaX500Name, boolean) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name getName() + public final boolean getValidating() + public int hashCode() + public String toString() +## +public final class net.corda.testing.node.MockNetworkParameters extends java.lang.Object + public () + public (boolean, boolean, net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy, List, net.corda.core.node.NetworkParameters) + public final boolean component1() + public final boolean component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy component3() + @org.jetbrains.annotations.NotNull public final List component4() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters component5() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters copy(boolean, boolean, net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy, List, net.corda.core.node.NetworkParameters) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NetworkParameters getNetworkParameters() + public final boolean getNetworkSendManuallyPumped() + @org.jetbrains.annotations.NotNull public final List getNotarySpecs() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy getServicePeerAllocationStrategy() + public final boolean getThreadPerNode() + public int hashCode() + public String toString() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters withNetworkParameters(net.corda.core.node.NetworkParameters) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters withNetworkSendManuallyPumped(boolean) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters withNotarySpecs(List) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters withServicePeerAllocationStrategy(net.corda.testing.node.InMemoryMessagingNetwork$ServicePeerAllocationStrategy) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNetworkParameters withThreadPerNode(boolean) +## +public final class net.corda.testing.node.MockNodeParameters extends java.lang.Object + public () + public (Integer, net.corda.core.identity.CordaX500Name, java.math.BigInteger, kotlin.jvm.functions.Function1, net.corda.node.VersionInfo) + @org.jetbrains.annotations.Nullable public final Integer component1() + @org.jetbrains.annotations.Nullable public final net.corda.core.identity.CordaX500Name component2() + @org.jetbrains.annotations.NotNull public final java.math.BigInteger component3() + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function1 component4() + @org.jetbrains.annotations.NotNull public final net.corda.node.VersionInfo component5() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNodeParameters copy(Integer, net.corda.core.identity.CordaX500Name, java.math.BigInteger, kotlin.jvm.functions.Function1, net.corda.node.VersionInfo) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function1 getConfigOverrides() + @org.jetbrains.annotations.NotNull public final java.math.BigInteger getEntropyRoot() + @org.jetbrains.annotations.Nullable public final Integer getForcedID() + @org.jetbrains.annotations.Nullable public final net.corda.core.identity.CordaX500Name getLegalName() + @org.jetbrains.annotations.NotNull public final net.corda.node.VersionInfo getVersion() + public int hashCode() + public String toString() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNodeParameters withConfigOverrides(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNodeParameters withEntropyRoot(java.math.BigInteger) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNodeParameters withForcedID(Integer) + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockNodeParameters withLegalName(net.corda.core.identity.CordaX500Name) +## +public class net.corda.testing.node.MockServices extends java.lang.Object implements net.corda.core.node.StateLoader, net.corda.core.node.ServiceHub + public () + public (List) + public (List, net.corda.core.identity.CordaX500Name) + public (List, net.corda.core.identity.CordaX500Name, net.corda.core.node.services.IdentityService) + public (net.corda.core.identity.CordaX500Name) + public (net.corda.core.identity.CordaX500Name, net.corda.core.node.services.IdentityService) + public final void addMockCordapp(String) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.serialization.SerializeAsToken cordaService(Class) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.FilteredTransaction) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.FilteredTransaction, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.SignedTransaction) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.SignedTransaction, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public final net.corda.testing.services.MockAttachmentStorage getAttachments() + @org.jetbrains.annotations.NotNull public java.time.Clock getClock() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.ContractUpgradeService getContractUpgradeService() + @org.jetbrains.annotations.NotNull public net.corda.core.cordapp.CordappProvider getCordappProvider() + @org.jetbrains.annotations.NotNull public final com.google.common.collect.MutableClassToInstanceMap getCordappServices() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.IdentityService getIdentityService() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.KeyManagementService getKeyManagementService() + @org.jetbrains.annotations.NotNull public static final net.corda.node.VersionInfo getMOCK_VERSION_INFO() + @org.jetbrains.annotations.NotNull public net.corda.core.node.NodeInfo getMyInfo() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.NetworkMapCache getNetworkMapCache() + @org.jetbrains.annotations.NotNull public net.corda.core.node.NetworkParameters getNetworkParameters() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.TransactionVerifierService getTransactionVerifierService() + @org.jetbrains.annotations.NotNull public net.corda.node.services.api.WritableTransactionStorage getValidatedTransactions() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.VaultService getVaultService() + @org.jetbrains.annotations.NotNull public java.sql.Connection jdbcSession() + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) + @org.jetbrains.annotations.NotNull public Set loadStates(Set) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final Properties makeTestDataSourceProperties(String) + public void recordTransactions(Iterable) + public void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) + public void recordTransactions(boolean, Iterable) + @org.jetbrains.annotations.NotNull public Void registerUnloadHandler(kotlin.jvm.functions.Function0) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, Iterable) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.StateAndRef toStateAndRef(net.corda.core.contracts.StateRef) + public static final net.corda.testing.node.MockServices$Companion Companion +## +public static final class net.corda.testing.node.MockServices$Companion extends java.lang.Object + @org.jetbrains.annotations.NotNull public final net.corda.node.VersionInfo getMOCK_VERSION_INFO() + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final Properties makeTestDataSourceProperties(String) +## +public static final class net.corda.testing.node.MockServices$Companion$makeTestDatabaseAndMockServices$mockService$1$1 extends net.corda.testing.node.MockServices + @org.jetbrains.annotations.NotNull public net.corda.node.services.api.VaultServiceInternal getVaultService() + @org.jetbrains.annotations.NotNull public java.sql.Connection jdbcSession() + public void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) +## +public final class net.corda.testing.node.MockServicesKt extends java.lang.Object + @org.jetbrains.annotations.NotNull public static final net.corda.core.serialization.SerializeAsToken createMockCordaService(net.corda.testing.node.MockServices, kotlin.jvm.functions.Function1) +## +public static final class net.corda.testing.node.MockServicesKt$createMockCordaService$MockAppServiceHubImpl extends java.lang.Object implements net.corda.core.node.AppServiceHub, net.corda.core.node.ServiceHub + public (net.corda.testing.node.MockServices, net.corda.testing.node.MockServices, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction addSignature(net.corda.core.transactions.SignedTransaction, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.serialization.SerializeAsToken cordaService(Class) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.FilteredTransaction) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.FilteredTransaction, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.SignedTransaction) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.TransactionSignature createSignature(net.corda.core.transactions.SignedTransaction, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.AttachmentStorage getAttachments() + @org.jetbrains.annotations.NotNull public java.time.Clock getClock() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.ContractUpgradeService getContractUpgradeService() + @org.jetbrains.annotations.NotNull public net.corda.core.cordapp.CordappProvider getCordappProvider() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.IdentityService getIdentityService() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.KeyManagementService getKeyManagementService() + @org.jetbrains.annotations.NotNull public net.corda.core.node.NodeInfo getMyInfo() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.NetworkMapCache getNetworkMapCache() + @org.jetbrains.annotations.NotNull public net.corda.core.node.NetworkParameters getNetworkParameters() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.MockServices getServiceHub() + @org.jetbrains.annotations.NotNull public final net.corda.core.serialization.SerializeAsToken getServiceInstance() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.TransactionVerifierService getTransactionVerifierService() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.TransactionStorage getValidatedTransactions() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.VaultService getVaultService() + @org.jetbrains.annotations.NotNull public java.sql.Connection jdbcSession() + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) + @org.jetbrains.annotations.NotNull public Set loadStates(Set) + public void recordTransactions(Iterable) + public void recordTransactions(net.corda.core.node.StatesToRecord, Iterable) + public void recordTransactions(boolean, Iterable) + public void registerUnloadHandler(kotlin.jvm.functions.Function0) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, Iterable) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.SignedTransaction signInitialTransaction(net.corda.core.transactions.TransactionBuilder, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public net.corda.core.messaging.FlowHandle startFlow(net.corda.core.flows.FlowLogic) + @org.jetbrains.annotations.NotNull public net.corda.core.messaging.FlowProgressHandle startTrackedFlow(net.corda.core.flows.FlowLogic) + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.StateAndRef toStateAndRef(net.corda.core.contracts.StateRef) +## +public class net.corda.testing.node.MockTransactionStorage extends net.corda.core.serialization.SingletonSerializeAsToken implements net.corda.node.services.api.WritableTransactionStorage + public () + public boolean addTransaction(net.corda.core.transactions.SignedTransaction) + @org.jetbrains.annotations.Nullable public net.corda.core.transactions.SignedTransaction getTransaction(net.corda.core.crypto.SecureHash) + @org.jetbrains.annotations.NotNull public rx.Observable getUpdates() + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) + @org.jetbrains.annotations.NotNull public Set loadStates(Set) + @org.jetbrains.annotations.NotNull public net.corda.core.messaging.DataFeed track() +## +public final class net.corda.testing.node.NodeTestUtils extends java.lang.Object + @org.jetbrains.annotations.NotNull public static final net.corda.testing.dsl.LedgerDSL ledger(net.corda.core.node.ServiceHub, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.dsl.LedgerDSL ledger(net.corda.core.node.ServiceHub, net.corda.core.identity.Party, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public static final net.corda.core.context.InvocationContext newContext(net.corda.node.services.api.StartedNodeServices) + @org.jetbrains.annotations.NotNull public static final net.corda.core.concurrent.CordaFuture startFlow(net.corda.node.services.api.StartedNodeServices, net.corda.core.flows.FlowLogic) + @org.jetbrains.annotations.NotNull public static final net.corda.core.context.Actor testActor(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public static final net.corda.core.context.InvocationContext testContext(net.corda.core.identity.CordaX500Name) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.dsl.LedgerDSL transaction(net.corda.core.node.ServiceHub, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.dsl.LedgerDSL transaction(net.corda.core.node.ServiceHub, net.corda.core.identity.Party, kotlin.jvm.functions.Function1) +## +public final class net.corda.testing.node.NotarySpec extends java.lang.Object + public (net.corda.core.identity.CordaX500Name, boolean, List, net.corda.node.services.config.VerifierType, net.corda.testing.node.ClusterSpec) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name component1() + public final boolean component2() + @org.jetbrains.annotations.NotNull public final List component3() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.config.VerifierType component4() + @org.jetbrains.annotations.Nullable public final net.corda.testing.node.ClusterSpec component5() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.NotarySpec copy(net.corda.core.identity.CordaX500Name, boolean, List, net.corda.node.services.config.VerifierType, net.corda.testing.node.ClusterSpec) + public boolean equals(Object) + @org.jetbrains.annotations.Nullable public final net.corda.testing.node.ClusterSpec getCluster() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name getName() + @org.jetbrains.annotations.NotNull public final List getRpcUsers() + public final boolean getValidating() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.config.VerifierType getVerifierType() + public int hashCode() + public String toString() +## +public final class net.corda.testing.node.StartedMockNode extends java.lang.Object + @org.jetbrains.annotations.NotNull public final List findStateMachines(Class) + public final int getId() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.NodeInfo getInfo() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.messaging.MessagingService getNetwork() + @org.jetbrains.annotations.NotNull public final net.corda.node.services.api.StartedNodeServices getServices() + @org.jetbrains.annotations.Nullable public final net.corda.testing.node.InMemoryMessagingNetwork$MessageTransfer pumpReceive(boolean) + @org.jetbrains.annotations.NotNull public final rx.Observable registerInitiatedFlow(Class) + public final void setMessagingServiceSpy(net.corda.testing.node.MessagingServiceSpy) + public final void stop() + public final Object transaction(kotlin.jvm.functions.Function0) + public static final net.corda.testing.node.StartedMockNode$Companion Companion +## +public static final class net.corda.testing.node.StartedMockNode$Companion extends java.lang.Object +## +@javax.annotation.concurrent.ThreadSafe public final class net.corda.testing.node.TestClock extends net.corda.node.MutableClock + public (java.time.Clock) + public synchronized final void advanceBy(java.time.Duration) + public synchronized final void setTo(java.time.Instant) +## +public final class net.corda.testing.node.UnstartedMockNode extends java.lang.Object + public final int getId() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.StartedMockNode start() + public static final net.corda.testing.node.UnstartedMockNode$Companion Companion +## +public static final class net.corda.testing.node.UnstartedMockNode$Companion extends java.lang.Object +## +public final class net.corda.testing.node.User extends java.lang.Object + public (String, String, Set) + @org.jetbrains.annotations.NotNull public final String component1() + @org.jetbrains.annotations.NotNull public final String component2() + @org.jetbrains.annotations.NotNull public final Set component3() + @org.jetbrains.annotations.NotNull public final net.corda.testing.node.User copy(String, String, Set) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final String getPassword() + @org.jetbrains.annotations.NotNull public final Set getPermissions() + @org.jetbrains.annotations.NotNull public final String getUsername() + public int hashCode() + public String toString() +## public final class net.corda.client.rpc.CordaRPCClient extends java.lang.Object public (net.corda.core.utilities.NetworkHostAndPort) public (net.corda.core.utilities.NetworkHostAndPort, net.corda.client.rpc.CordaRPCClientConfiguration) @org.jetbrains.annotations.NotNull public final net.corda.client.rpc.CordaRPCConnection start(String, String) @org.jetbrains.annotations.NotNull public final net.corda.client.rpc.CordaRPCConnection start(String, String, net.corda.core.context.Trace, net.corda.core.context.Actor) public final Object use(String, String, kotlin.jvm.functions.Function1) + public static final net.corda.client.rpc.CordaRPCClient$Companion Companion +## +public static final class net.corda.client.rpc.CordaRPCClient$Companion extends java.lang.Object ## public final class net.corda.client.rpc.CordaRPCClientConfiguration extends java.lang.Object public (java.time.Duration) @@ -3572,3 +4219,438 @@ public @interface net.corda.client.rpc.RPCSinceVersion public final class net.corda.client.rpc.UtilsKt extends java.lang.Object public static final void notUsed(rx.Observable) ## +public final class net.corda.testing.contracts.DummyContract extends java.lang.Object implements net.corda.core.contracts.Contract + public () + public (Object) + @org.jetbrains.annotations.Nullable public final Object component1() + @org.jetbrains.annotations.NotNull public final net.corda.testing.contracts.DummyContract copy(Object) + public boolean equals(Object) + @org.jetbrains.annotations.Nullable public final Object getBlank() + @org.jetbrains.annotations.NotNull public final String getPROGRAM_ID() + public int hashCode() + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.transactions.TransactionBuilder move(List, net.corda.core.identity.AbstractParty) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public static final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) + public String toString() + public void verify(net.corda.core.transactions.LedgerTransaction) + public static final net.corda.testing.contracts.DummyContract$Companion Companion + @org.jetbrains.annotations.NotNull public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContract" +## +public static interface net.corda.testing.contracts.DummyContract$Commands extends net.corda.core.contracts.CommandData +## +public static final class net.corda.testing.contracts.DummyContract$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContract$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContract$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContract$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContract$Companion extends java.lang.Object + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder move(List, net.corda.core.identity.AbstractParty) + @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder move(net.corda.core.contracts.StateAndRef, net.corda.core.identity.AbstractParty) +## +public static final class net.corda.testing.contracts.DummyContract$MultiOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State + public (int, List) + public final int component1() + @org.jetbrains.annotations.NotNull public final List component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.contracts.DummyContract$MultiOwnerState copy(int, List) + public boolean equals(Object) + public int getMagicNumber() + @org.jetbrains.annotations.NotNull public final List getOwners() + @org.jetbrains.annotations.NotNull public List getParticipants() + public int hashCode() + public String toString() +## +public static final class net.corda.testing.contracts.DummyContract$SingleOwnerState extends java.lang.Object implements net.corda.testing.contracts.DummyContract$State, net.corda.core.contracts.OwnableState + public (int, net.corda.core.identity.AbstractParty) + public final int component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.AbstractParty component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.contracts.DummyContract$SingleOwnerState copy(int, net.corda.core.identity.AbstractParty) + public boolean equals(Object) + public int getMagicNumber() + @org.jetbrains.annotations.NotNull public net.corda.core.identity.AbstractParty getOwner() + @org.jetbrains.annotations.NotNull public List getParticipants() + public int hashCode() + public String toString() + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.CommandAndState withNewOwner(net.corda.core.identity.AbstractParty) +## +@net.corda.core.DoNotImplement public static interface net.corda.testing.contracts.DummyContract$State extends net.corda.core.contracts.ContractState + public abstract int getMagicNumber() +## +public final class net.corda.testing.contracts.DummyContractV2 extends java.lang.Object implements net.corda.core.contracts.UpgradedContract + public () + @org.jetbrains.annotations.NotNull public String getLegacyContract() + @org.jetbrains.annotations.NotNull public net.corda.testing.contracts.DummyContractV2$State upgrade(net.corda.testing.contracts.DummyContract$State) + public void verify(net.corda.core.transactions.LedgerTransaction) + public static final net.corda.testing.contracts.DummyContractV2$Companion Companion + @org.jetbrains.annotations.NotNull public static final String PROGRAM_ID = "net.corda.testing.contracts.DummyContractV2" +## +public static interface net.corda.testing.contracts.DummyContractV2$Commands extends net.corda.core.contracts.CommandData +## +public static final class net.corda.testing.contracts.DummyContractV2$Commands$Create extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV2$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContractV2$Commands$Move extends net.corda.core.contracts.TypeOnlyCommandData implements net.corda.testing.contracts.DummyContractV2$Commands + public () +## +public static final class net.corda.testing.contracts.DummyContractV2$Companion extends java.lang.Object +## +public static final class net.corda.testing.contracts.DummyContractV2$State extends java.lang.Object implements net.corda.core.contracts.ContractState + public (int, List) + public final int component1() + @org.jetbrains.annotations.NotNull public final List component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.contracts.DummyContractV2$State copy(int, List) + public boolean equals(Object) + public final int getMagicNumber() + @org.jetbrains.annotations.NotNull public final List getOwners() + @org.jetbrains.annotations.NotNull public List getParticipants() + public int hashCode() + public String toString() +## +public final class net.corda.testing.contracts.DummyState extends java.lang.Object implements net.corda.core.contracts.ContractState + public () + public (int) + public final int component1() + @org.jetbrains.annotations.NotNull public final net.corda.testing.contracts.DummyState copy(int) + public boolean equals(Object) + public final int getMagicNumber() + @org.jetbrains.annotations.NotNull public List getParticipants() + public int hashCode() + public String toString() +## +public final class net.corda.testing.core.DummyCommandData extends net.corda.core.contracts.TypeOnlyCommandData + public static final net.corda.testing.core.DummyCommandData INSTANCE +## +public final class net.corda.testing.core.Expect extends java.lang.Object + public (Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final Class component1() + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function1 component2() + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function1 component3() + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.Expect copy(Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public final Class getClazz() + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function1 getExpectClosure() + @org.jetbrains.annotations.NotNull public final kotlin.jvm.functions.Function1 getMatch() + public int hashCode() + public String toString() +## +@net.corda.core.DoNotImplement public abstract class net.corda.testing.core.ExpectCompose extends java.lang.Object +## +public static final class net.corda.testing.core.ExpectCompose$Parallel extends net.corda.testing.core.ExpectCompose + public (List) + @org.jetbrains.annotations.NotNull public final List getParallel() +## +public static final class net.corda.testing.core.ExpectCompose$Sequential extends net.corda.testing.core.ExpectCompose + public (List) + @org.jetbrains.annotations.NotNull public final List getSequence() +## +public static final class net.corda.testing.core.ExpectCompose$Single extends net.corda.testing.core.ExpectCompose + public (net.corda.testing.core.Expect) + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.Expect getExpect() +## +public static final class net.corda.testing.core.ExpectComposeState$Companion extends java.lang.Object + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.ExpectComposeState fromExpectCompose(net.corda.testing.core.ExpectCompose) +## +public static final class net.corda.testing.core.ExpectComposeState$Finished extends net.corda.testing.core.ExpectComposeState + public () + @org.jetbrains.annotations.NotNull public List getExpectedEvents() + @org.jetbrains.annotations.Nullable public Void nextState(Object) +## +public static final class net.corda.testing.core.ExpectComposeState$Parallel extends net.corda.testing.core.ExpectComposeState + public (net.corda.testing.core.ExpectCompose$Parallel, List) + @org.jetbrains.annotations.NotNull public List getExpectedEvents() + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.ExpectCompose$Parallel getParallel() + @org.jetbrains.annotations.NotNull public final List getStates() + @org.jetbrains.annotations.Nullable public kotlin.Pair nextState(Object) +## +public static final class net.corda.testing.core.ExpectComposeState$Sequential extends net.corda.testing.core.ExpectComposeState + public (net.corda.testing.core.ExpectCompose$Sequential, int, net.corda.testing.core.ExpectComposeState) + @org.jetbrains.annotations.NotNull public List getExpectedEvents() + public final int getIndex() + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.ExpectCompose$Sequential getSequential() + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.ExpectComposeState getState() + @org.jetbrains.annotations.Nullable public kotlin.Pair nextState(Object) +## +public static final class net.corda.testing.core.ExpectComposeState$Single extends net.corda.testing.core.ExpectComposeState + public (net.corda.testing.core.ExpectCompose$Single) + @org.jetbrains.annotations.NotNull public List getExpectedEvents() + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.ExpectCompose$Single getSingle() + @org.jetbrains.annotations.Nullable public kotlin.Pair nextState(Object) +## +public final class net.corda.testing.core.ExpectKt extends java.lang.Object + @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose expect(Class, kotlin.jvm.functions.Function1, kotlin.jvm.functions.Function1) + public static final void expectEvents(Iterable, boolean, kotlin.jvm.functions.Function0) + public static final void expectEvents(rx.Observable, boolean, kotlin.jvm.functions.Function0) + public static final void genericExpectEvents(Object, boolean, kotlin.jvm.functions.Function2, kotlin.jvm.functions.Function0) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose parallel(List) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose replicate(int, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public static final net.corda.testing.core.ExpectCompose sequence(List) +## +public static final class net.corda.testing.core.ExpectKt$expectEvents$1$lock$1 extends java.lang.Object +## +@net.corda.core.DoNotImplement public interface net.corda.testing.core.GlobalSerializationEnvironment extends net.corda.core.serialization.internal.SerializationEnvironment + public abstract void unset() +## +public final class net.corda.testing.core.SerializationEnvironmentRule extends java.lang.Object implements org.junit.rules.TestRule + public () + public (boolean) + @org.jetbrains.annotations.NotNull public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement, org.junit.runner.Description) + @org.jetbrains.annotations.NotNull public final net.corda.core.serialization.SerializationContext getCheckpointContext() + @org.jetbrains.annotations.NotNull public final net.corda.core.serialization.SerializationFactory getSerializationFactory() + public static final net.corda.testing.core.SerializationEnvironmentRule$Companion Companion +## +public static final class net.corda.testing.core.SerializationEnvironmentRule$Companion extends java.lang.Object + public final Object run(String, kotlin.jvm.functions.Function1) +## +public static final class net.corda.testing.core.SerializationEnvironmentRule$apply$1 extends org.junit.runners.model.Statement + public void evaluate() +## +public final class net.corda.testing.core.TestConstants extends java.lang.Object + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name ALICE_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name BOB_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name BOC_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name CHARLIE_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_A_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_B_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_BANK_C_NAME + @kotlin.jvm.JvmField @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.CordaX500Name DUMMY_NOTARY_NAME + public static final int MAX_MESSAGE_SIZE = 10485760 + @kotlin.jvm.JvmField public static final java.time.Instant TEST_TX_TIME +## +public final class net.corda.testing.core.TestIdentity extends java.lang.Object + public (net.corda.core.identity.CordaX500Name) + public (net.corda.core.identity.CordaX500Name, long) + public (net.corda.core.identity.CordaX500Name, java.security.KeyPair) + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.PartyAndCertificate getIdentity() + @org.jetbrains.annotations.NotNull public final java.security.KeyPair getKeyPair() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.CordaX500Name getName() + @org.jetbrains.annotations.NotNull public final net.corda.core.identity.Party getParty() + @org.jetbrains.annotations.NotNull public final java.security.PublicKey getPublicKey() + public static final net.corda.testing.core.TestIdentity$Companion Companion +## +public static final class net.corda.testing.core.TestIdentity$Companion extends java.lang.Object + @org.jetbrains.annotations.NotNull public final net.corda.testing.core.TestIdentity fresh(String) +## +public final class net.corda.testing.core.TestUtils extends java.lang.Object + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.Party chooseIdentity(net.corda.core.node.NodeInfo) + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.PartyAndCertificate chooseIdentityAndCert(net.corda.core.node.NodeInfo) + @org.jetbrains.annotations.NotNull public static final net.corda.core.utilities.NetworkHostAndPort freeLocalHostAndPort() + public static final int freePort() + @org.jetbrains.annotations.NotNull public static final net.corda.core.contracts.StateRef generateStateRef() + @org.jetbrains.annotations.NotNull public static final List getFreeLocalPorts(String, int) + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.PartyAndCertificate getTestPartyAndCertificate(net.corda.core.identity.CordaX500Name, java.security.PublicKey) + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.PartyAndCertificate getTestPartyAndCertificate(net.corda.core.identity.Party) + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.Party singleIdentity(net.corda.core.node.NodeInfo) + @org.jetbrains.annotations.NotNull public static final net.corda.core.identity.PartyAndCertificate singleIdentityAndCert(net.corda.core.node.NodeInfo) +## +public final class net.corda.testing.dsl.AttachmentResolutionException extends net.corda.core.flows.FlowException + public (net.corda.core.crypto.SecureHash) +## +public final class net.corda.testing.dsl.DoubleSpentInputs extends net.corda.core.flows.FlowException + public (List) +## +public final class net.corda.testing.dsl.DuplicateOutputLabel extends net.corda.core.flows.FlowException + public (String) +## +@net.corda.core.DoNotImplement public abstract class net.corda.testing.dsl.EnforceVerifyOrFail extends java.lang.Object +## +public static final class net.corda.testing.dsl.EnforceVerifyOrFail$Token extends net.corda.testing.dsl.EnforceVerifyOrFail + public static final net.corda.testing.dsl.EnforceVerifyOrFail$Token INSTANCE +## +public final class net.corda.testing.dsl.LedgerDSL extends java.lang.Object implements net.corda.testing.dsl.LedgerDSLInterpreter + public (net.corda.testing.dsl.LedgerDSLInterpreter, net.corda.core.identity.Party) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.WireTransaction _transaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + public void _tweak(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.WireTransaction _unverifiedTransaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash attachment(java.io.InputStream) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails() + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails with(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail failsWith(String) + @org.jetbrains.annotations.NotNull public final net.corda.testing.dsl.LedgerDSLInterpreter getInterpreter() + @org.jetbrains.annotations.NotNull public final net.corda.core.contracts.ContractState retrieveOutput(Class, String) + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.StateAndRef retrieveOutputStateAndRef(Class, String) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction transaction(String, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction transaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction transaction(kotlin.jvm.functions.Function1) + public final void tweak(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction unverifiedTransaction(String, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction unverifiedTransaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction unverifiedTransaction(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail verifies() +## +@net.corda.core.DoNotImplement public interface net.corda.testing.dsl.LedgerDSLInterpreter extends net.corda.testing.dsl.OutputStateLookup, net.corda.testing.dsl.Verifies + @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.WireTransaction _transaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + public abstract void _tweak(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.transactions.WireTransaction _unverifiedTransaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public abstract net.corda.core.crypto.SecureHash attachment(java.io.InputStream) +## +@net.corda.core.DoNotImplement public interface net.corda.testing.dsl.OutputStateLookup + @org.jetbrains.annotations.NotNull public abstract net.corda.core.contracts.StateAndRef retrieveOutputStateAndRef(Class, String) +## +public final class net.corda.testing.dsl.TestLedgerDSLInterpreter extends java.lang.Object implements net.corda.testing.dsl.LedgerDSLInterpreter + public (net.corda.core.node.ServiceHub) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.WireTransaction _transaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + public void _tweak(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.core.transactions.WireTransaction _unverifiedTransaction(String, net.corda.core.transactions.TransactionBuilder, kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash attachment(java.io.InputStream) + @org.jetbrains.annotations.NotNull public final net.corda.core.node.ServiceHub component1() + @org.jetbrains.annotations.NotNull public final net.corda.testing.dsl.TestLedgerDSLInterpreter copy(net.corda.core.node.ServiceHub, HashMap, HashMap, HashMap) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails() + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails with(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail failsWith(String) + @org.jetbrains.annotations.NotNull public final net.corda.core.node.ServiceHub getServices() + @org.jetbrains.annotations.NotNull public final List getTransactionsToVerify() + @org.jetbrains.annotations.NotNull public final List getTransactionsUnverified() + @org.jetbrains.annotations.NotNull public final List getWireTransactions() + public int hashCode() + @org.jetbrains.annotations.Nullable public final String outputToLabel(net.corda.core.contracts.ContractState) + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.StateAndRef retrieveOutputStateAndRef(Class, String) + public String toString() + @org.jetbrains.annotations.Nullable public final String transactionName(net.corda.core.crypto.SecureHash) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail verifies() + public static final net.corda.testing.dsl.TestLedgerDSLInterpreter$Companion Companion +## +public static final class net.corda.testing.dsl.TestLedgerDSLInterpreter$Companion extends java.lang.Object +## +public static final class net.corda.testing.dsl.TestLedgerDSLInterpreter$TypeMismatch extends java.lang.Exception + public (Class, Class) +## +public static final class net.corda.testing.dsl.TestLedgerDSLInterpreter$VerifiesFailed extends java.lang.Exception + public (String, Throwable) +## +public static final class net.corda.testing.dsl.TestLedgerDSLInterpreter$WireTransactionWithLocation extends java.lang.Object + public (String, net.corda.core.transactions.WireTransaction, String) + @org.jetbrains.annotations.Nullable public final String component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction component2() + @org.jetbrains.annotations.Nullable public final String component3() + @org.jetbrains.annotations.NotNull public final net.corda.testing.dsl.TestLedgerDSLInterpreter$WireTransactionWithLocation copy(String, net.corda.core.transactions.WireTransaction, String) + public boolean equals(Object) + @org.jetbrains.annotations.Nullable public final String getLabel() + @org.jetbrains.annotations.Nullable public final String getLocation() + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.WireTransaction getTransaction() + public int hashCode() + public String toString() +## +public final class net.corda.testing.dsl.TestTransactionDSLInterpreter extends java.lang.Object implements net.corda.testing.dsl.TransactionDSLInterpreter, net.corda.testing.dsl.OutputStateLookup + public (net.corda.testing.dsl.TestLedgerDSLInterpreter, net.corda.core.transactions.TransactionBuilder) + public void _attachment(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail _tweak(kotlin.jvm.functions.Function1) + public void attachment(net.corda.core.crypto.SecureHash) + public void command(List, net.corda.core.contracts.CommandData) + @org.jetbrains.annotations.NotNull public final net.corda.testing.dsl.TestLedgerDSLInterpreter component1() + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder component2() + @org.jetbrains.annotations.NotNull public final net.corda.testing.dsl.TestTransactionDSLInterpreter copy(net.corda.testing.dsl.TestLedgerDSLInterpreter, net.corda.core.transactions.TransactionBuilder, HashMap) + public boolean equals(Object) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails() + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails with(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail failsWith(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.TestLedgerDSLInterpreter getLedgerInterpreter() + @org.jetbrains.annotations.NotNull public final net.corda.core.node.ServicesForResolution getServices() + @org.jetbrains.annotations.NotNull public final net.corda.core.transactions.TransactionBuilder getTransactionBuilder() + public int hashCode() + public void input(net.corda.core.contracts.StateRef) + public void output(String, String, net.corda.core.identity.Party, Integer, net.corda.core.contracts.AttachmentConstraint, net.corda.core.contracts.ContractState) + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.StateAndRef retrieveOutputStateAndRef(Class, String) + public void timeWindow(net.corda.core.contracts.TimeWindow) + public String toString() + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail verifies() +## +public static final class net.corda.testing.dsl.TestTransactionDSLInterpreter$services$1 extends java.lang.Object implements net.corda.core.node.ServicesForResolution + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.AttachmentStorage getAttachments() + @org.jetbrains.annotations.NotNull public net.corda.core.cordapp.CordappProvider getCordappProvider() + @org.jetbrains.annotations.NotNull public net.corda.core.node.services.IdentityService getIdentityService() + @org.jetbrains.annotations.NotNull public net.corda.core.node.NetworkParameters getNetworkParameters() + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.TransactionState loadState(net.corda.core.contracts.StateRef) + @org.jetbrains.annotations.NotNull public Set loadStates(Set) +## +public final class net.corda.testing.dsl.TransactionDSL extends java.lang.Object implements net.corda.testing.dsl.TransactionDSLInterpreter + public (net.corda.testing.dsl.TransactionDSLInterpreter, net.corda.core.identity.Party) + public void _attachment(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail _tweak(kotlin.jvm.functions.Function1) + public final void attachment(String) + public void attachment(net.corda.core.crypto.SecureHash) + public final void command(java.security.PublicKey, net.corda.core.contracts.CommandData) + public void command(List, net.corda.core.contracts.CommandData) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails() + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail fails with(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail failsWith(String) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.LedgerDSLInterpreter getLedgerInterpreter() + public final void input(String) + public final void input(String, net.corda.core.contracts.ContractState) + public void input(net.corda.core.contracts.StateRef) + public final void output(String, int, net.corda.core.contracts.ContractState) + public final void output(String, String, int, net.corda.core.contracts.ContractState) + public final void output(String, String, net.corda.core.contracts.ContractState) + public void output(String, String, net.corda.core.identity.Party, Integer, net.corda.core.contracts.AttachmentConstraint, net.corda.core.contracts.ContractState) + public final void output(String, String, net.corda.core.identity.Party, net.corda.core.contracts.ContractState) + public final void output(String, net.corda.core.contracts.ContractState) + public final void output(String, net.corda.core.identity.Party, net.corda.core.contracts.ContractState) + @org.jetbrains.annotations.NotNull public net.corda.core.contracts.StateAndRef retrieveOutputStateAndRef(Class, String) + public final void timeWindow(java.time.Instant) + public final void timeWindow(java.time.Instant, java.time.Duration) + public void timeWindow(net.corda.core.contracts.TimeWindow) + @org.jetbrains.annotations.NotNull public final net.corda.testing.dsl.EnforceVerifyOrFail tweak(kotlin.jvm.functions.Function1) + @org.jetbrains.annotations.NotNull public net.corda.testing.dsl.EnforceVerifyOrFail verifies() +## +@net.corda.core.DoNotImplement public interface net.corda.testing.dsl.TransactionDSLInterpreter extends net.corda.testing.dsl.OutputStateLookup, net.corda.testing.dsl.Verifies + public abstract void _attachment(String) + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.dsl.EnforceVerifyOrFail _tweak(kotlin.jvm.functions.Function1) + public abstract void attachment(net.corda.core.crypto.SecureHash) + public abstract void command(List, net.corda.core.contracts.CommandData) + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.dsl.LedgerDSLInterpreter getLedgerInterpreter() + public abstract void input(net.corda.core.contracts.StateRef) + public abstract void output(String, String, net.corda.core.identity.Party, Integer, net.corda.core.contracts.AttachmentConstraint, net.corda.core.contracts.ContractState) + public abstract void timeWindow(net.corda.core.contracts.TimeWindow) +## +@net.corda.core.DoNotImplement public interface net.corda.testing.dsl.Verifies + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.dsl.EnforceVerifyOrFail fails() + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.dsl.EnforceVerifyOrFail fails with(String) + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.dsl.EnforceVerifyOrFail failsWith(String) + @org.jetbrains.annotations.NotNull public abstract net.corda.testing.dsl.EnforceVerifyOrFail verifies() +## +public final class net.corda.testing.http.HttpApi extends java.lang.Object + public (java.net.URL, com.fasterxml.jackson.databind.ObjectMapper) + @org.jetbrains.annotations.NotNull public final com.fasterxml.jackson.databind.ObjectMapper getMapper() + @org.jetbrains.annotations.NotNull public final java.net.URL getRoot() + public final void postJson(String, Object) + public final void postPlain(String, String) + public final void putJson(String, Object) + public static final net.corda.testing.http.HttpApi$Companion Companion +## +public static final class net.corda.testing.http.HttpApi$Companion extends java.lang.Object + @org.jetbrains.annotations.NotNull public final net.corda.testing.http.HttpApi fromHostAndPort(net.corda.core.utilities.NetworkHostAndPort, String, String, com.fasterxml.jackson.databind.ObjectMapper) +## +public final class net.corda.testing.http.HttpUtils extends java.lang.Object + @org.jetbrains.annotations.NotNull public final com.fasterxml.jackson.databind.ObjectMapper getDefaultMapper() + public final void postJson(java.net.URL, String) + public final void postPlain(java.net.URL, String) + public final void putJson(java.net.URL, String) + public static final net.corda.testing.http.HttpUtils INSTANCE +## +public final class net.corda.testing.services.FlowStackSnapshotFactoryImpl extends java.lang.Object implements net.corda.node.services.statemachine.FlowStackSnapshotFactory + public () + @co.paralleluniverse.fibers.Suspendable @org.jetbrains.annotations.NotNull public net.corda.core.flows.FlowStackSnapshot getFlowStackSnapshot(Class) + public void persistAsJsonFile(Class, java.nio.file.Path, net.corda.core.flows.StateMachineRunId) +## +public static final class net.corda.testing.services.FlowStackSnapshotFactoryImpl$ThreadLocalIndex$Companion extends java.lang.Object + @org.jetbrains.annotations.NotNull public final ThreadLocal getCurrentIndex() +## +public static final class net.corda.testing.services.FlowStackSnapshotFactoryImpl$ThreadLocalIndex$Companion$currentIndex$1 extends java.lang.ThreadLocal + @org.jetbrains.annotations.NotNull protected Integer initialValue() +## +public final class net.corda.testing.services.FlowStackSnapshotKt extends java.lang.Object +## +public final class net.corda.testing.services.MockAttachmentStorage extends net.corda.core.serialization.SingletonSerializeAsToken implements net.corda.core.node.services.AttachmentStorage + public () + @org.jetbrains.annotations.NotNull public final kotlin.Pair getAttachmentIdAndBytes(java.io.InputStream) + @org.jetbrains.annotations.NotNull public final HashMap getFiles() + public boolean hasAttachment(net.corda.core.crypto.SecureHash) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash importAttachment(java.io.InputStream) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash importAttachment(java.io.InputStream, String, String) + @org.jetbrains.annotations.NotNull public net.corda.core.crypto.SecureHash importOrGetAttachment(java.io.InputStream) + @org.jetbrains.annotations.Nullable public net.corda.core.contracts.Attachment openAttachment(net.corda.core.crypto.SecureHash) + @org.jetbrains.annotations.NotNull public List queryAttachments(net.corda.core.node.services.vault.AttachmentQueryCriteria, net.corda.core.node.services.vault.AttachmentSort) + public static final net.corda.testing.services.MockAttachmentStorage$Companion Companion +## +public static final class net.corda.testing.services.MockAttachmentStorage$Companion extends java.lang.Object + public final byte[] getBytes(java.io.InputStream) +## diff --git a/core/src/main/kotlin/net/corda/core/internal/GlobalProperties.kt b/core/src/main/kotlin/net/corda/core/internal/GlobalProperties.kt deleted file mode 100644 index bedac0269a..0000000000 --- a/core/src/main/kotlin/net/corda/core/internal/GlobalProperties.kt +++ /dev/null @@ -1,14 +0,0 @@ -package net.corda.core.internal - -import net.corda.core.node.NetworkParameters - -// TODO: This will cause problems when we run tests in parallel, make each node have its own properties. -object GlobalProperties { - private var _networkParameters: NetworkParameters? = null - - var networkParameters: NetworkParameters - get() = checkNotNull(_networkParameters) { "Property 'networkParameters' has not been initialised." } - set(value) { - _networkParameters = value - } -} \ No newline at end of file diff --git a/core/src/main/kotlin/net/corda/core/node/ServiceHub.kt b/core/src/main/kotlin/net/corda/core/node/ServiceHub.kt index 1832ac1cb5..1ca40ff117 100644 --- a/core/src/main/kotlin/net/corda/core/node/ServiceHub.kt +++ b/core/src/main/kotlin/net/corda/core/node/ServiceHub.kt @@ -60,6 +60,9 @@ interface ServicesForResolution : StateLoader { /** Provides access to anything relating to cordapps including contract attachment resolution and app context */ val cordappProvider: CordappProvider + + /** Returns the network parameters the node is operating under. */ + val networkParameters: NetworkParameters } /** diff --git a/core/src/main/kotlin/net/corda/core/transactions/WireTransaction.kt b/core/src/main/kotlin/net/corda/core/transactions/WireTransaction.kt index d973152262..8a8aadfd6a 100644 --- a/core/src/main/kotlin/net/corda/core/transactions/WireTransaction.kt +++ b/core/src/main/kotlin/net/corda/core/transactions/WireTransaction.kt @@ -5,7 +5,6 @@ import net.corda.core.contracts.ComponentGroupEnum.* import net.corda.core.crypto.* import net.corda.core.identity.Party import net.corda.core.internal.Emoji -import net.corda.core.internal.GlobalProperties import net.corda.core.node.ServicesForResolution import net.corda.core.node.services.AttachmentId import net.corda.core.serialization.CordaSerializable @@ -85,11 +84,12 @@ class WireTransaction(componentGroups: List, val privacySalt: Pr */ @Throws(AttachmentResolutionException::class, TransactionResolutionException::class) fun toLedgerTransaction(services: ServicesForResolution): LedgerTransaction { - return toLedgerTransaction( + return toLedgerTransactionInternal( resolveIdentity = { services.identityService.partyFromKey(it) }, resolveAttachment = { services.attachments.openAttachment(it) }, resolveStateRef = { services.loadState(it) }, - resolveContractAttachment = { services.cordappProvider.getContractAttachmentID(it.contract) } + resolveContractAttachment = { services.cordappProvider.getContractAttachmentID(it.contract) }, + maxTransactionSize = services.networkParameters.maxTransactionSize ) } @@ -100,12 +100,23 @@ class WireTransaction(componentGroups: List, val privacySalt: Pr * @throws AttachmentResolutionException if a required attachment was not found using [resolveAttachment]. * @throws TransactionResolutionException if an input was not found not using [resolveStateRef]. */ + @Deprecated("Use toLedgerTransaction(ServicesForTransaction) instead.") @Throws(AttachmentResolutionException::class, TransactionResolutionException::class) fun toLedgerTransaction( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRef: (StateRef) -> TransactionState<*>?, resolveContractAttachment: (TransactionState) -> AttachmentId? + ): LedgerTransaction { + return toLedgerTransactionInternal(resolveIdentity, resolveAttachment, resolveStateRef, resolveContractAttachment, 10485760) + } + + private fun toLedgerTransactionInternal( + resolveIdentity: (PublicKey) -> Party?, + resolveAttachment: (SecureHash) -> Attachment?, + resolveStateRef: (StateRef) -> TransactionState<*>?, + resolveContractAttachment: (TransactionState) -> AttachmentId?, + maxTransactionSize: Int ): LedgerTransaction { // Look up public keys to authenticated identities. This is just a stub placeholder and will all change in future. val authenticatedArgs = commands.map { @@ -120,15 +131,15 @@ class WireTransaction(componentGroups: List, val privacySalt: Pr // Order of attachments is important since contracts may refer to indexes so only append automatic attachments val attachments = (attachments.map { resolveAttachment(it) ?: throw AttachmentResolutionException(it) } + contractAttachments).distinct() val ltx = LedgerTransaction(resolvedInputs, outputs, authenticatedArgs, attachments, id, notary, timeWindow, privacySalt) - checkTransactionSize(ltx) + checkTransactionSize(ltx, maxTransactionSize) return ltx } - private fun checkTransactionSize(ltx: LedgerTransaction) { - var remainingTransactionSize = GlobalProperties.networkParameters.maxTransactionSize + private fun checkTransactionSize(ltx: LedgerTransaction, maxTransactionSize: Int) { + var remainingTransactionSize = maxTransactionSize fun minus(size: Int) { - require(remainingTransactionSize > size) { "Transaction exceeded network's maximum transaction size limit : ${GlobalProperties.networkParameters.maxTransactionSize} bytes." } + require(remainingTransactionSize > size) { "Transaction exceeded network's maximum transaction size limit : $maxTransactionSize bytes." } remainingTransactionSize -= size } diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 247d21acdb..7dcb99bdc5 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -74,7 +74,10 @@ UNRELEASED :doc:`corda-configuration-file` for more details. * Introducing the concept of network parameters which are a set of constants which all nodes on a network must agree on - to correctly interop. + to correctly interop. These can be retrieved from ``ServiceHub.networkParameters``. + + * One of these parameters, ``maxTransactionSize``, limits the size of a transaction, including its attachments, so that + all nodes have sufficient memory to validate transactions. * The set of valid notaries has been moved to the network parameters. Notaries are no longer identified by the CN in their X500 name. @@ -87,9 +90,6 @@ UNRELEASED * Moved ``NodeInfoSchema`` to internal package as the node info's database schema is not part of the public API. This was needed to allow changes to the schema. - * Introduced max transaction size limit on transactions. The max transaction size parameter is set by the compatibility zone - operator. The parameter is distributed to Corda nodes by network map service as part of the ``NetworkParameters``. - * Support for external user credentials data source and password encryption [CORDA-827]. * Exporting additional JMX metrics (artemis, hibernate statistics) and loading Jolokia agent at JVM startup when using diff --git a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt index 5fa206af81..4c8a86c192 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt @@ -4,6 +4,9 @@ import com.nhaarman.mockito_kotlin.doReturn import com.nhaarman.mockito_kotlin.whenever import net.corda.core.contracts.Contract import net.corda.core.contracts.PartyAndReference +import net.corda.core.contracts.StateRef +import net.corda.core.contracts.TransactionState +import net.corda.core.cordapp.CordappProvider import net.corda.core.flows.FlowLogic import net.corda.core.flows.UnexpectedFlowEndException import net.corda.core.identity.CordaX500Name @@ -12,7 +15,9 @@ import net.corda.core.internal.concurrent.transpose import net.corda.core.internal.createDirectories import net.corda.core.internal.div import net.corda.core.internal.toLedgerTransaction +import net.corda.core.node.NetworkParameters import net.corda.core.node.ServicesForResolution +import net.corda.core.node.services.AttachmentStorage import net.corda.core.node.services.IdentityService import net.corda.core.serialization.SerializationFactory import net.corda.core.transactions.TransactionBuilder @@ -20,6 +25,7 @@ import net.corda.core.utilities.contextLogger import net.corda.core.utilities.getOrThrow import net.corda.node.internal.cordapp.CordappLoader import net.corda.node.internal.cordapp.CordappProviderImpl +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.DUMMY_BANK_A_NAME import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.core.SerializationEnvironmentRule @@ -78,12 +84,14 @@ class AttachmentLoadingTests { } } - private val services = rigorousMock().also { - doReturn(attachments).whenever(it).attachments - doReturn(provider).whenever(it).cordappProvider - doReturn(rigorousMock().also { - doReturn(null).whenever(it).partyFromKey(DUMMY_BANK_A.owningKey) - }).whenever(it).identityService + private val services = object : ServicesForResolution { + override fun loadState(stateRef: StateRef): TransactionState<*> = throw NotImplementedError() + override val identityService = rigorousMock().apply { + doReturn(null).whenever(this).partyFromKey(DUMMY_BANK_A.owningKey) + } + override val attachments: AttachmentStorage get() = this@AttachmentLoadingTests.attachments + override val cordappProvider: CordappProvider get() = this@AttachmentLoadingTests.provider + override val networkParameters: NetworkParameters = testNetworkParameters() } @Test diff --git a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt index cd5f572d50..aa007be6d7 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/statemachine/LargeTransactionsTest.kt @@ -9,6 +9,8 @@ import net.corda.core.internal.concurrent.transpose import net.corda.core.messaging.startFlow import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.getOrThrow +import net.corda.node.services.config.MB +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.contracts.DummyContract import net.corda.testing.contracts.DummyState import net.corda.testing.core.* @@ -68,11 +70,15 @@ class LargeTransactionsTest { fun checkCanSendLargeTransactions() { // These 4 attachments yield a transaction that's got >10mb attached, so it'd push us over the Artemis // max message size. - val bigFile1 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024 * 3, 0) - val bigFile2 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024 * 3, 1) - val bigFile3 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024 * 3, 2) - val bigFile4 = InputStreamAndHash.createInMemoryTestZip(1024 * 1024 * 3, 3) - driver(DriverParameters(startNodesInProcess = true, extraCordappPackagesToScan = listOf("net.corda.testing.contracts"), portAllocation = PortAllocation.RandomFree)) { + val bigFile1 = InputStreamAndHash.createInMemoryTestZip(3.MB.toInt(), 0) + val bigFile2 = InputStreamAndHash.createInMemoryTestZip(3.MB.toInt(), 1) + val bigFile3 = InputStreamAndHash.createInMemoryTestZip(3.MB.toInt(), 2) + val bigFile4 = InputStreamAndHash.createInMemoryTestZip(3.MB.toInt(), 3) + driver(DriverParameters( + startNodesInProcess = true, + extraCordappPackagesToScan = listOf("net.corda.testing.contracts"), + networkParameters = testNetworkParameters(maxTransactionSize = 13.MB.toInt()), + portAllocation = PortAllocation.RandomFree)) { val rpcUser = User("admin", "admin", setOf("ALL")) val (alice, _) = listOf(ALICE_NAME, BOB_NAME).map { startNode(providedName = it, rpcUsers = listOf(rpcUser)) }.transpose().getOrThrow() CordaRPCClient(alice.rpcAddress).use(rpcUser.username, rpcUser.password) { diff --git a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt index 6eae9358a5..0d2383edef 100644 --- a/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt @@ -14,7 +14,6 @@ import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party import net.corda.core.identity.PartyAndCertificate import net.corda.core.internal.FlowStateMachine -import net.corda.core.internal.GlobalProperties import net.corda.core.internal.VisibleForTesting import net.corda.core.internal.concurrent.map import net.corda.core.internal.concurrent.openFuture @@ -198,18 +197,27 @@ abstract class AbstractNode(val configuration: NodeConfiguration, val (identity, identityKeyPair) = obtainIdentity(notaryConfig = null) val identityService = makeIdentityService(identity.certificate) networkMapClient = configuration.compatibilityZoneURL?.let { NetworkMapClient(it, identityService.trustRoot) } - GlobalProperties.networkParameters = NetworkParametersReader(identityService.trustRoot, networkMapClient, configuration.baseDirectory).networkParameters - check(GlobalProperties.networkParameters.minimumPlatformVersion <= versionInfo.platformVersion) { + val networkParameters = NetworkParametersReader(identityService.trustRoot, networkMapClient, configuration.baseDirectory).networkParameters + check(networkParameters.minimumPlatformVersion <= versionInfo.platformVersion) { "Node's platform version is lower than network's required minimumPlatformVersion" } // Do all of this in a database transaction so anything that might need a connection has one. val (startedImpl, schedulerService) = initialiseDatabasePersistence(schemaService, identityService) { database -> - val networkMapCache = NetworkMapCacheImpl(PersistentNetworkMapCache(database, GlobalProperties.networkParameters.notaries).start(), identityService) + val networkMapCache = NetworkMapCacheImpl(PersistentNetworkMapCache(database, networkParameters.notaries).start(), identityService) val (keyPairs, nodeInfo) = initNodeInfo(networkMapCache, identity, identityKeyPair) identityService.loadIdentities(nodeInfo.legalIdentitiesAndCerts) val transactionStorage = makeTransactionStorage(database, configuration.transactionCacheSizeBytes) val nodeProperties = NodePropertiesPersistentStore(StubbedNodeUniqueIdProvider::value, database) - val nodeServices = makeServices(keyPairs, schemaService, transactionStorage, database, nodeInfo, identityService, networkMapCache, nodeProperties) + val nodeServices = makeServices( + keyPairs, + schemaService, + transactionStorage, + database, + nodeInfo, + identityService, + networkMapCache, + nodeProperties, + networkParameters) val notaryService = makeNotaryService(nodeServices, database) val smm = makeStateMachineManager(database) val flowLogicRefFactory = FlowLogicRefFactoryImpl(cordappLoader.appClassLoader) @@ -246,7 +254,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, networkMapUpdater = NetworkMapUpdater(services.networkMapCache, NodeInfoWatcher(configuration.baseDirectory, getRxIoScheduler(), Duration.ofMillis(configuration.additionalNodeInfoPollingFrequencyMsec)), networkMapClient, - GlobalProperties.networkParameters.serialize().hash, + networkParameters.serialize().hash, configuration.baseDirectory) runOnStop += networkMapUpdater::close @@ -539,7 +547,8 @@ abstract class AbstractNode(val configuration: NodeConfiguration, nodeInfo: NodeInfo, identityService: IdentityService, networkMapCache: NetworkMapCacheInternal, - nodeProperties: NodePropertiesStore): MutableList { + nodeProperties: NodePropertiesStore, + networkParameters: NetworkParameters): MutableList { checkpointStorage = DBCheckpointStorage() val metrics = MetricRegistry() attachments = NodeAttachmentService(metrics, configuration.attachmentContentCacheSizeBytes, configuration.attachmentCacheBound) @@ -555,8 +564,9 @@ abstract class AbstractNode(val configuration: NodeConfiguration, database, nodeInfo, networkMapCache, - nodeProperties) - network = makeMessagingService(database, nodeInfo, nodeProperties) + nodeProperties, + networkParameters) + network = makeMessagingService(database, nodeInfo, nodeProperties, networkParameters) val tokenizableServices = mutableListOf(attachments, network, services.vaultService, services.keyManagementService, services.identityService, platformClock, services.auditService, services.monitoringService, services.networkMapCache, services.schemaService, @@ -690,7 +700,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, _started = null } - protected abstract fun makeMessagingService(database: CordaPersistence, info: NodeInfo, nodeProperties: NodePropertiesStore): MessagingService + protected abstract fun makeMessagingService(database: CordaPersistence, info: NodeInfo, nodeProperties: NodePropertiesStore, networkParameters: NetworkParameters): MessagingService protected abstract fun startMessagingService(rpcOps: RPCOps) private fun obtainIdentity(notaryConfig: NotaryConfig?): Pair { @@ -762,7 +772,8 @@ abstract class AbstractNode(val configuration: NodeConfiguration, override val database: CordaPersistence, override val myInfo: NodeInfo, override val networkMapCache: NetworkMapCacheInternal, - override val nodeProperties: NodePropertiesStore + override val nodeProperties: NodePropertiesStore, + override val networkParameters: NetworkParameters ) : SingletonSerializeAsToken(), ServiceHubInternal, StateLoader by validatedTransactions { override val rpcFlows = ArrayList>>() override val stateMachineRecordedTransactionMapping = DBTransactionMappingStorage() diff --git a/node/src/main/kotlin/net/corda/node/internal/Node.kt b/node/src/main/kotlin/net/corda/node/internal/Node.kt index 7f4d58b19f..e4151b741c 100644 --- a/node/src/main/kotlin/net/corda/node/internal/Node.kt +++ b/node/src/main/kotlin/net/corda/node/internal/Node.kt @@ -7,6 +7,7 @@ import net.corda.core.internal.concurrent.thenMatch import net.corda.core.internal.div import net.corda.core.internal.uncheckedCast import net.corda.core.messaging.RPCOps +import net.corda.core.node.NetworkParameters import net.corda.core.node.NodeInfo import net.corda.core.node.ServiceHub import net.corda.core.node.services.IdentityService @@ -92,7 +93,6 @@ open class Node(configuration: NodeConfiguration, } ?: CordappLoader.createDefault(configuration.baseDirectory) } - // TODO Wire up maxMessageSize const val MAX_FILE_SIZE = 10485760 } @@ -149,7 +149,10 @@ open class Node(configuration: NodeConfiguration, private var shutdownHook: ShutdownHook? = null - override fun makeMessagingService(database: CordaPersistence, info: NodeInfo, nodeProperties: NodePropertiesStore): MessagingService { + override fun makeMessagingService(database: CordaPersistence, + info: NodeInfo, + nodeProperties: NodePropertiesStore, + networkParameters: NetworkParameters): MessagingService { // Construct security manager reading users data either from the 'security' config section // if present or from rpcUsers list if the former is missing from config. val securityManagerConfig = configuration.security?.authService ?: @@ -157,17 +160,21 @@ open class Node(configuration: NodeConfiguration, securityManager = RPCSecurityManagerImpl(securityManagerConfig) - val serverAddress = configuration.messagingServerAddress ?: makeLocalMessageBroker() - val rpcServerAddresses = if (configuration.rpcOptions.standAloneBroker) BrokerAddresses(configuration.rpcOptions.address!!, configuration.rpcOptions.adminAddress) else startLocalRpcBroker() + val serverAddress = configuration.messagingServerAddress ?: makeLocalMessageBroker(networkParameters) + val rpcServerAddresses = if (configuration.rpcOptions.standAloneBroker) { + BrokerAddresses(configuration.rpcOptions.address!!, configuration.rpcOptions.adminAddress) + } else { + startLocalRpcBroker(networkParameters) + } val advertisedAddress = info.addresses[0] - bridgeControlListener = BridgeControlListener(configuration, serverAddress, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) + bridgeControlListener = BridgeControlListener(configuration, serverAddress, MAX_FILE_SIZE) printBasicNodeInfo("Incoming connection address", advertisedAddress.toString()) rpcServerAddresses?.let { - rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) + rpcMessagingClient = RPCMessagingClient(configuration.rpcOptions.sslConfig, it.admin, MAX_FILE_SIZE) } verifierMessagingClient = when (configuration.verifierType) { - VerifierType.OutOfProcess -> VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) + VerifierType.OutOfProcess -> VerifierMessagingClient(configuration, serverAddress, services.monitoringService.metrics, MAX_FILE_SIZE) VerifierType.InMemory -> null } require(info.legalIdentities.size in 1..2) { "Currently nodes must have a primary address and optionally one serviced address" } @@ -182,21 +189,36 @@ open class Node(configuration: NodeConfiguration, database, services.networkMapCache, advertisedAddress, - /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, + MAX_FILE_SIZE, isDrainingModeOn = nodeProperties.flowsDrainingMode::isEnabled, drainingModeWasChangedEvents = nodeProperties.flowsDrainingMode.values) } - private fun startLocalRpcBroker(): BrokerAddresses? { + private fun startLocalRpcBroker(networkParameters: NetworkParameters): BrokerAddresses? { with(configuration) { return rpcOptions.address?.let { require(rpcOptions.address != null) { "RPC address needs to be specified for local RPC broker." } val rpcBrokerDirectory: Path = baseDirectory / "brokers" / "rpc" with(rpcOptions) { rpcBroker = if (useSsl) { - ArtemisRpcBroker.withSsl(this.address!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, exportJMXto.isNotEmpty(), rpcBrokerDirectory) + ArtemisRpcBroker.withSsl( + this.address!!, + sslConfig, + securityManager, + certificateChainCheckPolicies, + MAX_FILE_SIZE, + exportJMXto.isNotEmpty(), + rpcBrokerDirectory) } else { - ArtemisRpcBroker.withoutSsl(this.address!!, adminAddress!!, sslConfig, securityManager, certificateChainCheckPolicies, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE, exportJMXto.isNotEmpty(), rpcBrokerDirectory) + ArtemisRpcBroker.withoutSsl( + this.address!!, + adminAddress!!, + sslConfig, + securityManager, + certificateChainCheckPolicies, + MAX_FILE_SIZE, + exportJMXto.isNotEmpty(), + rpcBrokerDirectory) } } return rpcBroker!!.addresses @@ -204,16 +226,14 @@ open class Node(configuration: NodeConfiguration, } } - private fun makeLocalMessageBroker(): NetworkHostAndPort { + private fun makeLocalMessageBroker(networkParameters: NetworkParameters): NetworkHostAndPort { with(configuration) { - messageBroker = ArtemisMessagingServer(this, p2pAddress.port, /*networkParameters.maxMessageSize*/MAX_FILE_SIZE) + messageBroker = ArtemisMessagingServer(this, p2pAddress.port, MAX_FILE_SIZE) return NetworkHostAndPort("localhost", p2pAddress.port) } } - override fun myAddresses(): List { - return listOf(configuration.messagingServerAddress ?: getAdvertisedAddress()) - } + override fun myAddresses(): List = listOf(getAdvertisedAddress()) private fun getAdvertisedAddress(): NetworkHostAndPort { return with(configuration) { diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt index 283ae2c71a..6582196e27 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapClientTest.kt @@ -98,7 +98,7 @@ class NetworkMapClientTest { @Test fun `handle parameters update`() { - val nextParameters = testNetworkParameters(emptyList(), epoch = 2) + val nextParameters = testNetworkParameters(epoch = 2) val originalNetworkParameterHash = server.networkParameters.serialize().hash val nextNetworkParameterHash = nextParameters.serialize().hash val description = "Test parameters" diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt index a00bf44a35..fd0214955d 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkMapUpdaterTest.kt @@ -201,7 +201,7 @@ class NetworkMapUpdaterTest { val snapshot = paramsFeed.snapshot val updates = paramsFeed.updates.bufferUntilSubscribed() assertEquals(null, snapshot) - val newParameters = testNetworkParameters(emptyList(), epoch = 2) + val newParameters = testNetworkParameters(epoch = 2) val updateDeadline = Instant.now().plus(1, ChronoUnit.DAYS) scheduleParametersUpdate(newParameters, "Test update", updateDeadline) updater.subscribeToNetworkMap() @@ -219,7 +219,7 @@ class NetworkMapUpdaterTest { @Test fun `ack network parameters update`() { - val newParameters = testNetworkParameters(emptyList(), epoch = 314) + val newParameters = testNetworkParameters(epoch = 314) scheduleParametersUpdate(newParameters, "Test update", Instant.MIN) updater.subscribeToNetworkMap() // TODO: Remove sleep in unit test. diff --git a/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt b/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt index abd8d33fd1..86fba98581 100644 --- a/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/network/NetworkParametersReaderTest.kt @@ -50,7 +50,7 @@ class NetworkParametersReaderTest { fun `read correct set of parameters from file`() { val fs = Jimfs.newFileSystem(Configuration.unix()) val baseDirectory = fs.getPath("/node").createDirectories() - val oldParameters = testNetworkParameters(emptyList(), epoch = 1) + val oldParameters = testNetworkParameters(epoch = 1) NetworkParametersCopier(oldParameters).install(baseDirectory) NetworkParametersCopier(server.networkParameters, update = true).install(baseDirectory) // Parameters update file. val parameters = NetworkParametersReader(DEV_ROOT_CA.certificate, networkMapClient, baseDirectory).networkParameters diff --git a/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt b/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt index 77e508a692..6b06f8a50c 100644 --- a/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/transactions/MaxTransactionSizeTests.kt @@ -8,6 +8,7 @@ import net.corda.core.internal.InputStreamAndHash import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.getOrThrow import net.corda.node.services.api.StartedNodeServices +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.contracts.DummyContract import net.corda.testing.contracts.DummyState import net.corda.testing.core.ALICE_NAME @@ -34,7 +35,9 @@ class MaxTransactionSizeTests { @Before fun setup() { - mockNet = InternalMockNetwork(listOf("net.corda.testing.contracts", "net.corda.node.services.transactions"), maxTransactionSize = 3_000_000) + mockNet = InternalMockNetwork( + listOf("net.corda.testing.contracts", "net.corda.node.services.transactions"), + networkParameters = testNetworkParameters(maxTransactionSize = 3_000_000)) val aliceNode = mockNet.createNode(MockNodeParameters(legalName = ALICE_NAME)) val bobNode = mockNet.createNode(MockNodeParameters(legalName = BOB_NAME)) notaryServices = mockNet.defaultNotaryNode.services diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt index c75bf3f447..04e0b34c37 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultQueryTests.kt @@ -110,7 +110,7 @@ class VaultQueryTests { cordappPackages, makeTestIdentityService(MEGA_CORP_IDENTITY, MINI_CORP_IDENTITY, dummyCashIssuer.identity, dummyNotary.identity), megaCorp, - DUMMY_NOTARY_KEY) + moreKeys = DUMMY_NOTARY_KEY) database = databaseAndServices.first services = databaseAndServices.second vaultFiller = VaultFiller(services, dummyNotary) diff --git a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt index 1dcb7cb984..e7e3a50ea2 100644 --- a/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/vault/VaultWithCashTest.kt @@ -1,6 +1,9 @@ package net.corda.node.services.vault -import net.corda.core.contracts.* +import net.corda.core.contracts.ContractState +import net.corda.core.contracts.InsufficientBalanceException +import net.corda.core.contracts.LinearState +import net.corda.core.contracts.UniqueIdentifier import net.corda.core.crypto.generateKeyPair import net.corda.core.identity.AnonymousParty import net.corda.core.identity.CordaX500Name @@ -74,7 +77,7 @@ class VaultWithCashTest { cordappPackages, makeTestIdentityService(MEGA_CORP_IDENTITY, MINI_CORP_IDENTITY, dummyCashIssuer.identity, dummyNotary.identity), TestIdentity(MEGA_CORP.name, servicesKey), - dummyNotary.keyPair) + moreKeys = dummyNotary.keyPair) database = databaseAndServices.first services = databaseAndServices.second vaultFiller = VaultFiller(services, dummyNotary) diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt index bf06b7cb08..a74222d496 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt @@ -8,12 +8,13 @@ import net.corda.core.flows.FlowLogic import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party import net.corda.core.messaging.CordaRPCOps +import net.corda.core.node.NetworkParameters import net.corda.core.node.NodeInfo import net.corda.core.utilities.NetworkHostAndPort import net.corda.node.internal.Node import net.corda.node.services.api.StartedNodeServices import net.corda.node.services.config.VerifierType -import net.corda.nodeapi.internal.persistence.CordaPersistence +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.node.NotarySpec import net.corda.testing.node.User @@ -25,7 +26,6 @@ import java.net.InetSocketAddress import java.net.ServerSocket import java.nio.file.Path import java.nio.file.Paths -import java.sql.Connection import java.util.concurrent.atomic.AtomicInteger /** @@ -109,6 +109,12 @@ data class NodeParameters( fun setMaximumHeapSize(maximumHeapSize: String): NodeParameters = copy(maximumHeapSize = maximumHeapSize) } +/** + * @property startJmxHttpServer Indicates whether the spawned nodes should start with a Jolokia JMX agent to enable remote + * JMX monitoring using HTTP/JSON + * @property jmxHttpServerPortAllocation The port allocation strategy to use for remote Jolokia/JMX monitoring over HTTP. + * Defaults to incremental. + */ data class JmxPolicy(val startJmxHttpServer: Boolean = false, val jmxHttpServerPortAllocation: PortAllocation? = if (startJmxHttpServer) PortAllocation.Incremental(7005) else null) @@ -128,30 +134,10 @@ data class JmxPolicy(val startJmxHttpServer: Boolean = false, * * @param defaultParameters The default parameters for the driver. Allows the driver to be configured in builder style * when called from Java code. - * @param isDebug Indicates whether the spawned nodes should start in jdwt debug mode and have debug level logging. - * @param driverDirectory The base directory node directories go into, defaults to "build//". The node - * directories themselves are "//", where legalName defaults to "-" - * and may be specified in [DriverDSL.startNode]. - * @param portAllocation The port allocation strategy to use for the messaging and the web server addresses. Defaults to incremental. - * @param debugPortAllocation The port allocation strategy to use for jvm debugging. Defaults to incremental. - * @param systemProperties A Map of extra system properties which will be given to each new node. Defaults to empty. - * @param useTestClock If true the test clock will be used in Node. - * @param startNodesInProcess Provides the default behaviour of whether new nodes should start inside this process or - * not. Note that this may be overridden in [DriverDSL.startNode]. - * @param waitForAllNodesToFinish If true, the nodes will not shut down automatically after executing the code in the driver DSL block. - * It will wait for them to be shut down externally instead. - * @param notarySpecs The notaries advertised for this network. These nodes will be started automatically and will be - * available from [DriverDSL.notaryHandles]. Defaults to a simple validating notary. - * @param jmxPolicy Used to specify whether to expose JMX metrics via Jolokia HHTP/JSON. Defines two attributes: - * startJmxHttpServer: indicates whether the spawned nodes should start with a Jolokia JMX agent to enable remote JMX monitoring using HTTP/JSON. - * jmxHttpServerPortAllocation: the port allocation strategy to use for remote Jolokia/JMX monitoring over HTTP. Defaults to incremental. * @param dsl The dsl itself. * @return The value returned in the [dsl] closure. */ -fun driver( - defaultParameters: DriverParameters = DriverParameters(), - dsl: DriverDSL.() -> A -): A { +fun driver(defaultParameters: DriverParameters = DriverParameters(), dsl: DriverDSL.() -> A): A { return genericDriver( driverDsl = DriverDSLImpl( portAllocation = defaultParameters.portAllocation, @@ -166,7 +152,7 @@ fun driver( extraCordappPackagesToScan = defaultParameters.extraCordappPackagesToScan, jmxPolicy = defaultParameters.jmxPolicy, compatibilityZone = null, - maxTransactionSize = defaultParameters.maxTransactionSize + networkParameters = defaultParameters.networkParameters ), coerce = { it }, dsl = dsl, @@ -174,7 +160,25 @@ fun driver( ) } -/** Helper builder for configuring a [driver] from Java. */ +/** Builder for configuring a [driver] from Java. + * @param isDebug Indicates whether the spawned nodes should start in jdwt debug mode and have debug level logging. + * @param driverDirectory The base directory node directories go into, defaults to "build//". The node + * directories themselves are "//", where legalName defaults to "-" + * and may be specified in [DriverDSL.startNode]. + * @param portAllocation The port allocation strategy to use for the messaging and the web server addresses. Defaults to incremental. + * @param debugPortAllocation The port allocation strategy to use for jvm debugging. Defaults to incremental. + * @param systemProperties A Map of extra system properties which will be given to each new node. Defaults to empty. + * @param useTestClock If true the test clock will be used in Node. + * @param startNodesInProcess Provides the default behaviour of whether new nodes should start inside this process or + * not. Note that this may be overridden in [DriverDSL.startNode]. + * @param waitForAllNodesToFinish If true, the nodes will not shut down automatically after executing the code in the driver DSL block. + * It will wait for them to be shut down externally instead. + * @param notarySpecs The notaries advertised for this network. These nodes will be started automatically and will be + * available from [DriverDSL.notaryHandles]. Defaults to a simple validating notary. + * @param jmxPolicy Used to specify whether to expose JMX metrics via Jolokia HHTP/JSON. + * @property networkParameters The network parameters to be used by all the nodes. [NetworkParameters.notaries] must be + * empty as notaries are defined by [notarySpecs]. + */ @Suppress("unused") data class DriverParameters( val isDebug: Boolean = false, @@ -189,18 +193,19 @@ data class DriverParameters( val notarySpecs: List = listOf(NotarySpec(DUMMY_NOTARY_NAME)), val extraCordappPackagesToScan: List = emptyList(), val jmxPolicy: JmxPolicy = JmxPolicy(), - val maxTransactionSize: Int = Int.MAX_VALUE + val networkParameters: NetworkParameters = testNetworkParameters() ) { - fun setIsDebug(isDebug: Boolean) = copy(isDebug = isDebug) - fun setDriverDirectory(driverDirectory: Path) = copy(driverDirectory = driverDirectory) - fun setPortAllocation(portAllocation: PortAllocation) = copy(portAllocation = portAllocation) - fun setDebugPortAllocation(debugPortAllocation: PortAllocation) = copy(debugPortAllocation = debugPortAllocation) - fun setSystemProperties(systemProperties: Map) = copy(systemProperties = systemProperties) - fun setUseTestClock(useTestClock: Boolean) = copy(useTestClock = useTestClock) - fun setInitialiseSerialization(initialiseSerialization: Boolean) = copy(initialiseSerialization = initialiseSerialization) - fun setStartNodesInProcess(startNodesInProcess: Boolean) = copy(startNodesInProcess = startNodesInProcess) - fun setWaitForAllNodesToFinish(waitForAllNodesToFinish: Boolean) = copy(waitForAllNodesToFinish = waitForAllNodesToFinish) - fun setNotarySpecs(notarySpecs: List) = copy(notarySpecs = notarySpecs) - fun setExtraCordappPackagesToScan(extraCordappPackagesToScan: List) = copy(extraCordappPackagesToScan = extraCordappPackagesToScan) - fun setJmxPolicy(jmxPolicy: JmxPolicy) = copy(jmxPolicy = jmxPolicy) + fun setIsDebug(isDebug: Boolean): DriverParameters = copy(isDebug = isDebug) + fun setDriverDirectory(driverDirectory: Path): DriverParameters = copy(driverDirectory = driverDirectory) + fun setPortAllocation(portAllocation: PortAllocation): DriverParameters = copy(portAllocation = portAllocation) + fun setDebugPortAllocation(debugPortAllocation: PortAllocation): DriverParameters = copy(debugPortAllocation = debugPortAllocation) + fun setSystemProperties(systemProperties: Map): DriverParameters = copy(systemProperties = systemProperties) + fun setUseTestClock(useTestClock: Boolean): DriverParameters = copy(useTestClock = useTestClock) + fun setInitialiseSerialization(initialiseSerialization: Boolean): DriverParameters = copy(initialiseSerialization = initialiseSerialization) + fun setStartNodesInProcess(startNodesInProcess: Boolean): DriverParameters = copy(startNodesInProcess = startNodesInProcess) + fun setWaitForAllNodesToFinish(waitForAllNodesToFinish: Boolean): DriverParameters = copy(waitForAllNodesToFinish = waitForAllNodesToFinish) + fun setNotarySpecs(notarySpecs: List): DriverParameters = copy(notarySpecs = notarySpecs) + fun setExtraCordappPackagesToScan(extraCordappPackagesToScan: List): DriverParameters = copy(extraCordappPackagesToScan = extraCordappPackagesToScan) + fun setJmxPolicy(jmxPolicy: JmxPolicy): DriverParameters = copy(jmxPolicy = jmxPolicy) + fun setNetworkParameters(networkParameters: NetworkParameters): DriverParameters = copy(networkParameters = networkParameters) } \ No newline at end of file diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNetwork.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNetwork.kt index 5ad79acf1c..233726f21c 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNetwork.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNetwork.kt @@ -6,12 +6,14 @@ import net.corda.core.crypto.random63BitValue import net.corda.core.flows.FlowLogic import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party +import net.corda.core.node.NetworkParameters import net.corda.core.node.NodeInfo import net.corda.node.VersionInfo import net.corda.node.internal.StartedNode import net.corda.node.services.api.StartedNodeServices import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.messaging.MessagingService +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.DUMMY_NOTARY_NAME import net.corda.testing.node.internal.InternalMockNetwork import net.corda.testing.node.internal.setMessagingServiceSpy @@ -63,14 +65,16 @@ data class MockNetworkParameters( val networkSendManuallyPumped: Boolean = false, val threadPerNode: Boolean = false, val servicePeerAllocationStrategy: InMemoryMessagingNetwork.ServicePeerAllocationStrategy = InMemoryMessagingNetwork.ServicePeerAllocationStrategy.Random(), - val notarySpecs: List = listOf(MockNetworkNotarySpec(DUMMY_NOTARY_NAME))) { + val notarySpecs: List = listOf(MockNetworkNotarySpec(DUMMY_NOTARY_NAME)), + val networkParameters: NetworkParameters = testNetworkParameters()) { fun withNetworkSendManuallyPumped(networkSendManuallyPumped: Boolean): MockNetworkParameters = copy(networkSendManuallyPumped = networkSendManuallyPumped) fun withThreadPerNode(threadPerNode: Boolean): MockNetworkParameters = copy(threadPerNode = threadPerNode) fun withServicePeerAllocationStrategy(servicePeerAllocationStrategy: InMemoryMessagingNetwork.ServicePeerAllocationStrategy): MockNetworkParameters = copy(servicePeerAllocationStrategy = servicePeerAllocationStrategy) fun withNotarySpecs(notarySpecs: List): MockNetworkParameters = copy(notarySpecs = notarySpecs) + fun withNetworkParameters(networkParameters: NetworkParameters): MockNetworkParameters = copy(networkParameters = networkParameters) } -/** Represents a node configuration for injection via [MockNetworkParameters]. */ +/** Represents a node configuration for injection via [MockNetworkParameters] */ data class MockNetworkNotarySpec(val name: CordaX500Name, val validating: Boolean = true) { constructor(name: CordaX500Name) : this(name, validating = true) } @@ -100,7 +104,7 @@ class StartedMockNode private constructor(private val node: StartedNode> registerInitiatedFlow(initiatedFlowClass: Class): Observable = node.registerInitiatedFlow(initiatedFlowClass) /** @@ -151,6 +155,9 @@ class StartedMockNode private constructor(private val node: StartedNode = defaultParameters.notarySpecs + val notarySpecs: List = defaultParameters.notarySpecs, + val networkParameters: NetworkParameters = defaultParameters.networkParameters ) { @JvmOverloads constructor(cordappPackages: List, parameters: MockNetworkParameters = MockNetworkParameters()) : this(cordappPackages, defaultParameters = parameters) - private val internalMockNetwork: InternalMockNetwork = InternalMockNetwork(cordappPackages, defaultParameters, networkSendManuallyPumped, threadPerNode, servicePeerAllocationStrategy, notarySpecs) - + private val internalMockNetwork = InternalMockNetwork( + cordappPackages, + defaultParameters, + networkSendManuallyPumped, + threadPerNode, + servicePeerAllocationStrategy, + notarySpecs, + networkParameters) /** Which node will be used as the primary notary during transaction builds. */ - val defaultNotaryNode get(): StartedMockNode = StartedMockNode.create(internalMockNetwork.defaultNotaryNode) + val defaultNotaryNode get() : StartedMockNode = StartedMockNode.create(internalMockNetwork.defaultNotaryNode) /** The [Party] of the [defaultNotaryNode] */ - val defaultNotaryIdentity get(): Party = internalMockNetwork.defaultNotaryIdentity + val defaultNotaryIdentity get() : Party = internalMockNetwork.defaultNotaryIdentity /** A list of all notary nodes in the network that have been started. */ - val notaryNodes get(): List = internalMockNetwork.notaryNodes.map { StartedMockNode.create(it) } + val notaryNodes get() : List = internalMockNetwork.notaryNodes.map { StartedMockNode.create(it) } /** In a mock network, nodes have an incrementing integer ID. Real networks do not have this. Returns the next ID that will be used. */ - val nextNodeId get(): Int = internalMockNetwork.nextNodeId + val nextNodeId get() : Int = internalMockNetwork.nextNodeId /** Create a started node with the given identity. **/ fun createPartyNode(legalName: CordaX500Name? = null): StartedMockNode = StartedMockNode.create(internalMockNetwork.createPartyNode(legalName)) @@ -181,9 +195,7 @@ open class MockNetwork( /** Create a started node with the given parameters. **/ fun createNode(parameters: MockNodeParameters = MockNodeParameters()): StartedMockNode = StartedMockNode.create(internalMockNetwork.createNode(parameters)) - /** - * Create a started node with the given parameters. - * + /** Create a started node with the given parameters. * @param legalName the node's legal name. * @param forcedID a unique identifier for the node. * @param entropyRoot the initial entropy value to use when generating keys. Defaults to an (insecure) random value, @@ -204,9 +216,7 @@ open class MockNetwork( /** Create an unstarted node with the given parameters. **/ fun createUnstartedNode(parameters: MockNodeParameters = MockNodeParameters()): UnstartedMockNode = UnstartedMockNode.create(internalMockNetwork.createUnstartedNode(parameters)) - /** - * Create an unstarted node with the given parameters. - * + /** Create an unstarted node with the given parameters. * @param legalName the node's legal name. * @param forcedID a unique identifier for the node. * @param entropyRoot the initial entropy value to use when generating keys. Defaults to an (insecure) random value, diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt index f993b38298..3dd0e0f8be 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt @@ -7,7 +7,6 @@ import net.corda.core.crypto.* import net.corda.core.flows.FlowLogic import net.corda.core.identity.CordaX500Name import net.corda.core.identity.PartyAndCertificate -import net.corda.core.internal.GlobalProperties import net.corda.core.messaging.DataFeed import net.corda.core.messaging.FlowHandle import net.corda.core.messaging.FlowProgressHandle @@ -33,10 +32,11 @@ import net.corda.node.services.vault.NodeVaultService import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.nodeapi.internal.persistence.HibernateConfiguration +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.TestIdentity import net.corda.testing.internal.DEV_ROOT_CA -import net.corda.testing.services.MockAttachmentStorage import net.corda.testing.internal.MockCordappProvider +import net.corda.testing.services.MockAttachmentStorage import org.bouncycastle.operator.ContentSigner import rx.Observable import rx.subjects.PublishSubject @@ -62,6 +62,7 @@ open class MockServices private constructor( cordappLoader: CordappLoader, override val validatedTransactions: WritableTransactionStorage, override val identityService: IdentityService, + override val networkParameters: NetworkParameters, private val initialIdentity: TestIdentity, private val moreKeys: Array ) : ServiceHub, StateLoader by validatedTransactions { @@ -95,16 +96,18 @@ open class MockServices private constructor( * @return a pair where the first element is the instance of [CordaPersistence] and the second is [MockServices]. */ @JvmStatic + @JvmOverloads fun makeTestDatabaseAndMockServices(cordappPackages: List, identityService: IdentityService, initialIdentity: TestIdentity, + networkParameters: NetworkParameters = testNetworkParameters(), vararg moreKeys: KeyPair): Pair { val cordappLoader = CordappLoader.createWithTestPackages(cordappPackages) val dataSourceProps = makeTestDataSourceProperties() val schemaService = NodeSchemaService(cordappLoader.cordappSchemas) val database = configureDatabase(dataSourceProps, DatabaseConfig(), identityService, schemaService) val mockService = database.transaction { - object : MockServices(cordappLoader, identityService, initialIdentity, moreKeys) { + object : MockServices(cordappLoader, identityService, networkParameters, initialIdentity, moreKeys) { override val vaultService: VaultServiceInternal = makeVaultService(database.hibernateConfig, schemaService) override fun recordTransactions(statesToRecord: StatesToRecord, txs: Iterable) { @@ -128,30 +131,43 @@ open class MockServices private constructor( } } - private constructor(cordappLoader: CordappLoader, identityService: IdentityService, + private constructor(cordappLoader: CordappLoader, identityService: IdentityService, networkParameters: NetworkParameters, initialIdentity: TestIdentity, moreKeys: Array) - : this(cordappLoader, MockTransactionStorage(), identityService, initialIdentity, moreKeys) + : this(cordappLoader, MockTransactionStorage(), identityService, networkParameters, initialIdentity, moreKeys) /** * Create a mock [ServiceHub] that looks for app code in the given package names, uses the provided identity service * (you can get one from [makeTestIdentityService]) and represents the given identity. */ @JvmOverloads - constructor(cordappPackages: List, initialIdentity: TestIdentity, identityService: IdentityService = makeTestIdentityService(), vararg moreKeys: KeyPair) : this(CordappLoader.createWithTestPackages(cordappPackages), identityService, initialIdentity, moreKeys) + constructor(cordappPackages: List, + initialIdentity: TestIdentity, + identityService: IdentityService = makeTestIdentityService(), + vararg moreKeys: KeyPair) : + this(CordappLoader.createWithTestPackages(cordappPackages), identityService, testNetworkParameters(), initialIdentity, moreKeys) + + constructor(cordappPackages: List, + initialIdentity: TestIdentity, + identityService: IdentityService, + networkParameters: NetworkParameters, + vararg moreKeys: KeyPair) : + this(CordappLoader.createWithTestPackages(cordappPackages), identityService, networkParameters, initialIdentity, moreKeys) /** * Create a mock [ServiceHub] that looks for app code in the given package names, uses the provided identity service * (you can get one from [makeTestIdentityService]) and represents the given identity. */ @JvmOverloads - constructor(cordappPackages: List, initialIdentityName: CordaX500Name, identityService: IdentityService = makeTestIdentityService(), key: KeyPair, vararg moreKeys: KeyPair) : this(cordappPackages, TestIdentity(initialIdentityName, key), identityService, *moreKeys) + constructor(cordappPackages: List, initialIdentityName: CordaX500Name, identityService: IdentityService = makeTestIdentityService(), key: KeyPair, vararg moreKeys: KeyPair) : + this(cordappPackages, TestIdentity(initialIdentityName, key), identityService, *moreKeys) /** * Create a mock [ServiceHub] that can't load CorDapp code, which uses the provided identity service * (you can get one from [makeTestIdentityService]) and which represents the given identity. */ @JvmOverloads - constructor(cordappPackages: List, initialIdentityName: CordaX500Name, identityService: IdentityService = makeTestIdentityService()) : this(cordappPackages, TestIdentity(initialIdentityName), identityService) + constructor(cordappPackages: List, initialIdentityName: CordaX500Name, identityService: IdentityService = makeTestIdentityService()) : + this(cordappPackages, TestIdentity(initialIdentityName), identityService) /** * Create a mock [ServiceHub] that can't load CorDapp code, and which uses a default service identity. diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/NodeTestUtils.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/NodeTestUtils.kt index e0d3d7b98a..e156a1a847 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/NodeTestUtils.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/NodeTestUtils.kt @@ -10,14 +10,11 @@ import net.corda.core.context.InvocationOrigin import net.corda.core.flows.FlowLogic import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party -import net.corda.core.internal.GlobalProperties -import net.corda.core.internal.FlowStateMachine import net.corda.core.node.ServiceHub import net.corda.core.serialization.internal.effectiveSerializationEnv import net.corda.core.transactions.TransactionBuilder import net.corda.core.utilities.getOrThrow import net.corda.node.services.api.StartedNodeServices -import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.SerializationEnvironmentRule import net.corda.testing.core.TestIdentity import net.corda.testing.core.chooseIdentity @@ -38,7 +35,6 @@ fun ServiceHub.ledger( false } return LedgerDSL(TestLedgerDSLInterpreter(this), notary).apply { - GlobalProperties.networkParameters = testNetworkParameters(emptyList()) if (serializationExists) { script() } else { diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index f5978eded5..e7cc449d84 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -15,6 +15,7 @@ import net.corda.core.identity.CordaX500Name import net.corda.core.internal.* import net.corda.core.internal.concurrent.* import net.corda.core.messaging.CordaRPCOps +import net.corda.core.node.NetworkParameters import net.corda.core.node.NotaryInfo import net.corda.core.node.services.NetworkMapCache import net.corda.core.serialization.deserialize @@ -39,15 +40,14 @@ import net.corda.nodeapi.internal.crypto.X509KeyStore import net.corda.nodeapi.internal.crypto.X509Utilities import net.corda.nodeapi.internal.network.NetworkParametersCopier import net.corda.nodeapi.internal.network.NodeInfoFilesCopier -import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.ALICE_NAME import net.corda.testing.core.BOB_NAME import net.corda.testing.core.DUMMY_BANK_A_NAME -import net.corda.testing.internal.setGlobalSerialization import net.corda.testing.driver.* import net.corda.testing.driver.internal.InProcessImpl import net.corda.testing.driver.internal.NodeHandleInternal import net.corda.testing.driver.internal.OutOfProcessImpl +import net.corda.testing.internal.setGlobalSerialization import net.corda.testing.node.ClusterSpec import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO import net.corda.testing.node.NotarySpec @@ -92,7 +92,7 @@ class DriverDSLImpl( val jmxPolicy: JmxPolicy, val notarySpecs: List, val compatibilityZone: CompatibilityZoneParams?, - val maxTransactionSize: Int + val networkParameters: NetworkParameters ) : InternalDriverDSL { private var _executorService: ScheduledExecutorService? = null val executorService get() = _executorService!! @@ -387,6 +387,7 @@ class DriverDSLImpl( if (startNodesInProcess) { Schedulers.reset() } + require(networkParameters.notaries.isEmpty()) { "Define notaries using notarySpecs" } _executorService = Executors.newScheduledThreadPool(2, ThreadFactoryBuilder().setNameFormat("driver-pool-thread-%d").build()) _shutdownManager = ShutdownManager(executorService) val notaryInfosFuture = if (compatibilityZone == null) { @@ -704,7 +705,7 @@ class DriverDSLImpl( * The local version of the network map, which is a bunch of classes that copy the relevant files to the node directories. */ private inner class LocalNetworkMap(notaryInfos: List) { - val networkParametersCopier = NetworkParametersCopier(testNetworkParameters(notaryInfos, maxTransactionSize = maxTransactionSize)) + val networkParametersCopier = NetworkParametersCopier(networkParameters.copy(notaries = notaryInfos)) // TODO: this object will copy NodeInfo files from started nodes to other nodes additional-node-infos/ // This uses the FileSystem and adds a delay (~5 seconds) given by the time we wait before polling the file system. // Investigate whether we can avoid that. @@ -966,7 +967,7 @@ fun genericDriver( jmxPolicy = defaultParameters.jmxPolicy, notarySpecs = defaultParameters.notarySpecs, compatibilityZone = null, - maxTransactionSize = defaultParameters.maxTransactionSize + networkParameters = defaultParameters.networkParameters ) ) val shutdownHook = addShutdownHook(driverDsl::shutdown) @@ -1008,7 +1009,7 @@ fun internalDriver( notarySpecs: List = DriverParameters().notarySpecs, extraCordappPackagesToScan: List = DriverParameters().extraCordappPackagesToScan, jmxPolicy: JmxPolicy = DriverParameters().jmxPolicy, - maxTransactionSize: Int = DriverParameters().maxTransactionSize, + networkParameters: NetworkParameters = DriverParameters().networkParameters, compatibilityZone: CompatibilityZoneParams? = null, dsl: DriverDSLImpl.() -> A ): A { @@ -1026,7 +1027,7 @@ fun internalDriver( extraCordappPackagesToScan = extraCordappPackagesToScan, jmxPolicy = jmxPolicy, compatibilityZone = compatibilityZone, - maxTransactionSize = maxTransactionSize + networkParameters = networkParameters ), coerce = { it }, dsl = dsl, diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt index 119049e1a9..df4b43ee1e 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalMockNetwork.kt @@ -18,6 +18,7 @@ import net.corda.core.messaging.CordaRPCOps import net.corda.core.messaging.MessageRecipients import net.corda.core.messaging.RPCOps import net.corda.core.messaging.SingleMessageRecipient +import net.corda.core.node.NetworkParameters import net.corda.core.node.NodeInfo import net.corda.core.node.NotaryInfo import net.corda.core.node.services.IdentityService @@ -47,12 +48,11 @@ import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.DatabaseConfig import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.internal.rigorousMock +import net.corda.testing.internal.setGlobalSerialization import net.corda.testing.internal.testThreadFactory import net.corda.testing.node.* import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties -import net.corda.testing.internal.setGlobalSerialization -import net.corda.testing.node.TestClock import org.apache.activemq.artemis.utils.ReusableLatch import org.apache.sshd.common.util.security.SecurityUtils import rx.internal.schedulers.CachedThreadScheduler @@ -82,13 +82,14 @@ open class InternalMockNetwork(private val cordappPackages: List, val threadPerNode: Boolean = defaultParameters.threadPerNode, servicePeerAllocationStrategy: InMemoryMessagingNetwork.ServicePeerAllocationStrategy = defaultParameters.servicePeerAllocationStrategy, val notarySpecs: List = defaultParameters.notarySpecs, - maxTransactionSize: Int = Int.MAX_VALUE, + networkParameters: NetworkParameters = testNetworkParameters(), val defaultFactory: (MockNodeArgs) -> MockNode = InternalMockNetwork::MockNode) { init { // Apache SSHD for whatever reason registers a SFTP FileSystemProvider - which gets loaded by JimFS. // This SFTP support loads BouncyCastle, which we want to avoid. // Please see https://issues.apache.org/jira/browse/SSHD-736 - it's easier then to create our own fork of SSHD SecurityUtils.setAPrioriDisabledProvider("BC", true) // XXX: Why isn't this static? + require(networkParameters.notaries.isEmpty()) { "Define notaries using notarySpecs" } } var nextNodeId = 0 @@ -98,7 +99,7 @@ open class InternalMockNetwork(private val cordappPackages: List, val messagingNetwork = InMemoryMessagingNetwork.create(networkSendManuallyPumped, servicePeerAllocationStrategy, busyLatch) // A unique identifier for this network to segregate databases with the same nodeID but different networks. private val networkId = random63BitValue() - private val networkParameters: NetworkParametersCopier + private val networkParametersCopier: NetworkParametersCopier private val _nodes = mutableListOf() private val serializationEnv = try { setGlobalSerialization(true) @@ -174,7 +175,7 @@ open class InternalMockNetwork(private val cordappPackages: List, filesystem.getPath("/nodes").createDirectory() val notaryInfos = generateNotaryIdentities() // The network parameters must be serialised before starting any of the nodes - networkParameters = NetworkParametersCopier(testNetworkParameters(notaryInfos, maxTransactionSize = maxTransactionSize)) + networkParametersCopier = NetworkParametersCopier(networkParameters.copy(notaries = notaryInfos)) @Suppress("LeakingThis") notaryNodes = createNotaries() } catch (t: Throwable) { @@ -226,7 +227,7 @@ open class InternalMockNetwork(private val cordappPackages: List, override val started: StartedNode? get() = uncheckedCast(super.started) override fun start(): StartedNode { - mockNet.networkParameters.install(configuration.baseDirectory) + mockNet.networkParametersCopier.install(configuration.baseDirectory) val started: StartedNode = uncheckedCast(super.start()) advertiseNodeToNetwork(started) return started @@ -244,7 +245,7 @@ open class InternalMockNetwork(private val cordappPackages: List, // We only need to override the messaging service here, as currently everything that hits disk does so // through the java.nio API which we are already mocking via Jimfs. - override fun makeMessagingService(database: CordaPersistence, info: NodeInfo, nodeProperties: NodePropertiesStore): MessagingService { + override fun makeMessagingService(database: CordaPersistence, info: NodeInfo, nodeProperties: NodePropertiesStore, networkParameters: NetworkParameters): MessagingService { require(id >= 0) { "Node ID must be zero or positive, was passed: " + id } return mockNet.messagingNetwork.createNodeWithID( !mockNet.threadPerNode, @@ -292,9 +293,9 @@ open class InternalMockNetwork(private val cordappPackages: List, // Allow unit tests to modify the serialization whitelist list before the node start, // so they don't have to ServiceLoad test whitelists into all unit tests. - val testSerializationWhitelists by lazy { super.serializationWhitelists.toMutableList() } + private val _serializationWhitelists by lazy { super.serializationWhitelists.toMutableList() } override val serializationWhitelists: List - get() = testSerializationWhitelists + get() = _serializationWhitelists private var dbCloser: (() -> Any?)? = null override fun initialiseDatabasePersistence(schemaService: SchemaService, identityService: IdentityService, insideTransaction: (CordaPersistence) -> T): T { return super.initialiseDatabasePersistence(schemaService, identityService) { database -> diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt index 560a52a865..dd8237450b 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/NodeBasedTest.kt @@ -53,7 +53,7 @@ abstract class NodeBasedTest(private val cordappPackages: List = emptyLi @Before fun init() { - defaultNetworkParameters = NetworkParametersCopier(testNetworkParameters(emptyList())) + defaultNetworkParameters = NetworkParametersCopier(testNetworkParameters()) } /** diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt index e2770f4b80..040f42057d 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/RPCDriver.kt @@ -15,6 +15,7 @@ import net.corda.core.internal.concurrent.map import net.corda.core.internal.div import net.corda.core.internal.uncheckedCast import net.corda.core.messaging.RPCOps +import net.corda.core.node.NetworkParameters import net.corda.core.utilities.NetworkHostAndPort import net.corda.node.internal.security.RPCSecurityManagerImpl import net.corda.node.services.messaging.RPCServer @@ -23,6 +24,7 @@ import net.corda.nodeapi.ArtemisTcpTransport import net.corda.nodeapi.ConnectionDirection import net.corda.nodeapi.RPCApi import net.corda.nodeapi.internal.serialization.KRYO_RPC_CLIENT_CONTEXT +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.core.MAX_MESSAGE_SIZE import net.corda.testing.driver.JmxPolicy import net.corda.testing.driver.PortAllocation @@ -106,7 +108,7 @@ fun rpcDriver( notarySpecs: List = emptyList(), externalTrace: Trace? = null, jmxPolicy: JmxPolicy = JmxPolicy(), - maxTransactionSize: Int = Int.MAX_VALUE, + networkParameters: NetworkParameters = testNetworkParameters(), dsl: RPCDriverDSL.() -> A ): A { return genericDriver( @@ -124,7 +126,7 @@ fun rpcDriver( notarySpecs = notarySpecs, jmxPolicy = jmxPolicy, compatibilityZone = null, - maxTransactionSize = maxTransactionSize + networkParameters = networkParameters ), externalTrace ), coerce = { it }, @@ -157,7 +159,7 @@ data class RPCDriverDSL( private val driverDSL: DriverDSLImpl, private val externalTrace: Trace? ) : InternalDriverDSL by driverDSL { private companion object { - val notificationAddress = "notifications" + const val notificationAddress = "notifications" private fun ConfigurationImpl.configureCommonSettings(maxFileSize: Int, maxBufferedBytesPerClient: Long) { managementNotificationAddress = SimpleString(notificationAddress) diff --git a/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt b/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt index 38ebfc9d2b..11ec0e7bb7 100644 --- a/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt +++ b/testing/smoke-test-utils/src/main/kotlin/net/corda/smoketesting/NodeProcess.kt @@ -9,8 +9,8 @@ import net.corda.core.internal.div import net.corda.core.utilities.NetworkHostAndPort import net.corda.core.utilities.contextLogger import net.corda.nodeapi.internal.network.NetworkParametersCopier -import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.common.internal.asContextEnv +import net.corda.testing.common.internal.testNetworkParameters import java.net.URL import java.nio.file.Path import java.nio.file.Paths @@ -51,8 +51,8 @@ class NodeProcess( // TODO All use of this factory have duplicate code which is either bundling the calling module or a 3rd party module // as a CorDapp for the nodes. class Factory( - val buildDirectory: Path = Paths.get("build"), - val cordaJarUrl: URL? = this::class.java.getResource("/corda.jar") + private val buildDirectory: Path = Paths.get("build"), + private val cordaJarUrl: URL? = this::class.java.getResource("/corda.jar") ) { val cordaJar: Path by lazy { require(cordaJarUrl != null, { "corda.jar could not be found in classpath" }) @@ -66,7 +66,7 @@ class NodeProcess( KryoClientSerializationScheme.createSerializationEnv().asContextEnv { // There are no notaries in the network parameters for smoke test nodes. If this is required then we would // need to introduce the concept of a "network" which predefines the notaries, like the driver and MockNetwork - NetworkParametersCopier(testNetworkParameters(emptyList())) + NetworkParametersCopier(testNetworkParameters()) } } diff --git a/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/ParametersUtilities.kt b/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/ParametersUtilities.kt index ea089257c2..322e9e90b7 100644 --- a/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/ParametersUtilities.kt +++ b/testing/test-common/src/main/kotlin/net/corda/testing/common/internal/ParametersUtilities.kt @@ -5,12 +5,12 @@ import net.corda.core.node.NotaryInfo import java.time.Instant fun testNetworkParameters( - notaries: List, + notaries: List = emptyList(), minimumPlatformVersion: Int = 1, modifiedTime: Instant = Instant.now(), maxMessageSize: Int = 10485760, // TODO: Make this configurable and consistence across driver, bootstrapper, demobench and NetworkMapServer - maxTransactionSize: Int = Int.MAX_VALUE, + maxTransactionSize: Int = maxMessageSize, epoch: Int = 1 ): NetworkParameters { return NetworkParameters( diff --git a/verifier/src/integration-test/kotlin/net/corda/verifier/GeneratedLedger.kt b/verifier/src/integration-test/kotlin/net/corda/verifier/GeneratedLedger.kt index fe79e5d5a1..c74bce899b 100644 --- a/verifier/src/integration-test/kotlin/net/corda/verifier/GeneratedLedger.kt +++ b/verifier/src/integration-test/kotlin/net/corda/verifier/GeneratedLedger.kt @@ -1,17 +1,26 @@ package net.corda.verifier +import com.nhaarman.mockito_kotlin.any +import com.nhaarman.mockito_kotlin.doAnswer +import com.nhaarman.mockito_kotlin.whenever import net.corda.client.mock.Generator import net.corda.core.contracts.* +import net.corda.core.cordapp.CordappProvider import net.corda.core.crypto.SecureHash import net.corda.core.crypto.entropyToKeyPair import net.corda.core.identity.AbstractParty import net.corda.core.identity.AnonymousParty import net.corda.core.identity.CordaX500Name import net.corda.core.identity.Party +import net.corda.core.node.ServicesForResolution +import net.corda.core.node.services.AttachmentStorage +import net.corda.core.node.services.IdentityService import net.corda.core.transactions.LedgerTransaction import net.corda.core.transactions.WireTransaction import net.corda.nodeapi.internal.serialization.GeneratedAttachment +import net.corda.testing.common.internal.testNetworkParameters import net.corda.testing.contracts.DummyContract +import net.corda.testing.internal.rigorousMock import java.math.BigInteger import java.security.PublicKey import java.util.* @@ -28,25 +37,36 @@ data class GeneratedLedger( val attachments: Set, val identities: Set ) { - val hashTransactionMap: Map by lazy { transactions.associateBy(WireTransaction::id) } - val attachmentMap: Map by lazy { attachments.associateBy(Attachment::id) } - val identityMap: Map by lazy { identities.associateBy(Party::owningKey) } - val contractAttachmentMap: Map by lazy { + private val hashTransactionMap: Map by lazy { transactions.associateBy(WireTransaction::id) } + private val attachmentMap: Map by lazy { attachments.associateBy(Attachment::id) } + private val identityMap: Map by lazy { identities.associateBy(Party::owningKey) } + private val contractAttachmentMap: Map by lazy { attachments.mapNotNull { it as? ContractAttachment }.associateBy { it.contract } } + private val services = object : ServicesForResolution { + override fun loadState(stateRef: StateRef): TransactionState<*> { + return hashTransactionMap[stateRef.txhash]?.outputs?.get(stateRef.index) ?: throw TransactionResolutionException(stateRef.txhash) + } + override val identityService = rigorousMock().apply { + doAnswer { identityMap[it.arguments[0]] }.whenever(this).partyFromKey(any()) + } + override val attachments = rigorousMock().apply { + doAnswer { attachmentMap[it.arguments[0]] }.whenever(this).openAttachment(any()) + } + override val cordappProvider = rigorousMock().apply { + doAnswer { contractAttachmentMap[it.arguments[0]]?.id }.whenever(this).getContractAttachmentID(any()) + } + override val networkParameters = testNetworkParameters() + } + companion object { val empty = GeneratedLedger(emptyList(), emptyMap(), emptySet(), emptySet()) val contractAttachment = ContractAttachment(GeneratedAttachment(ByteArray(0) { 0 }), DummyContract.PROGRAM_ID) } fun resolveWireTransaction(transaction: WireTransaction): LedgerTransaction { - return transaction.toLedgerTransaction( - resolveIdentity = { identityMap[it] }, - resolveAttachment = { attachmentMap[it] }, - resolveStateRef = { hashTransactionMap[it.txhash]?.outputs?.get(it.index) }, - resolveContractAttachment = { contractAttachmentMap[it.contract]?.id } - ) + return transaction.toLedgerTransaction(services) } val attachmentsGenerator: Generator> by lazy { diff --git a/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt b/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt index 50c1b8d7e1..d9c6fcef06 100644 --- a/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt +++ b/verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt @@ -5,13 +5,13 @@ import com.typesafe.config.ConfigFactory import net.corda.core.concurrent.CordaFuture import net.corda.core.crypto.random63BitValue import net.corda.core.identity.CordaX500Name -import net.corda.core.internal.GlobalProperties import net.corda.core.internal.concurrent.OpenFuture import net.corda.core.internal.concurrent.doneFuture import net.corda.core.internal.concurrent.fork import net.corda.core.internal.concurrent.openFuture import net.corda.core.internal.createDirectories import net.corda.core.internal.div +import net.corda.core.node.NetworkParameters import net.corda.core.serialization.internal.nodeSerializationEnv import net.corda.core.transactions.LedgerTransaction import net.corda.core.utilities.NetworkHostAndPort @@ -64,7 +64,7 @@ fun verifierDriver( extraCordappPackagesToScan: List = emptyList(), notarySpecs: List = emptyList(), jmxPolicy: JmxPolicy = JmxPolicy(), - maxTransactionSize: Int = Int.MAX_VALUE, + networkParameters: NetworkParameters = testNetworkParameters(), dsl: VerifierDriverDSL.() -> A ) = genericDriver( driverDsl = VerifierDriverDSL( @@ -81,7 +81,7 @@ fun verifierDriver( notarySpecs = notarySpecs, jmxPolicy = jmxPolicy, compatibilityZone = null, - maxTransactionSize = maxTransactionSize + networkParameters = networkParameters ) ), coerce = { it }, @@ -167,7 +167,6 @@ data class VerifierDriverDSL(private val driverDSL: DriverDSLImpl) : InternalDri /** Starts a lightweight verification requestor that implements the Node's Verifier API */ fun startVerificationRequestor(name: CordaX500Name): CordaFuture { val hostAndPort = driverDSL.portAllocation.nextHostAndPort() - GlobalProperties.networkParameters = testNetworkParameters(emptyList(), maxTransactionSize = driverDSL.maxTransactionSize) return driverDSL.executorService.fork { startVerificationRequestorInternal(name, hostAndPort) }