Package com.exonum.binding.testkit
Class EmulatedNode
java.lang.Object
com.exonum.binding.testkit.EmulatedNode
public class EmulatedNode
extends java.lang.Object
Context of the TestKit emulated node, i.e., on which it instantiates and executes services.
-
Constructor Summary
Constructors Constructor Description EmulatedNode(int validatorId, KeyPair serviceKeyPair)
Creates a context of an emulated node. -
Method Summary
Modifier and Type Method Description EmulatedNodeType
getNodeType()
Returns a node type - eitherEmulatedNodeType.VALIDATOR
orEmulatedNodeType.AUDITOR
.KeyPair
getServiceKeyPair()
Returns a service key pair of this node.java.util.OptionalInt
getValidatorId()
Returns a validator id if this node is a validator orOptionalInt.empty()
if this is an auditor node.
-
Constructor Details
-
EmulatedNode
Creates a context of an emulated node.- Parameters:
validatorId
- identifier of the validator node; or any negative value if the node is an auditorserviceKeyPair
- service key pair of the node
-
-
Method Details
-
getNodeType
Returns a node type - eitherEmulatedNodeType.VALIDATOR
orEmulatedNodeType.AUDITOR
. -
getValidatorId
public java.util.OptionalInt getValidatorId()Returns a validator id if this node is a validator orOptionalInt.empty()
if this is an auditor node. -
getServiceKeyPair
Returns a service key pair of this node. This key pair is used to sign transactions Node.submitTransaction(RawTransaction) produced} by the service itself.
-