Package com.exonum.binding.testkit
Class EmulatedNode
- java.lang.Object
-
- com.exonum.binding.testkit.EmulatedNode
-
public class EmulatedNode extends 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.OptionalInt
getValidatorId()
Returns a validator id if this node is a validator orOptionalInt.empty()
if this is an auditor node.
-
-
-
Constructor Detail
-
EmulatedNode
public EmulatedNode(int validatorId, KeyPair serviceKeyPair)
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 Detail
-
getNodeType
public EmulatedNodeType getNodeType()
Returns a node type - eitherEmulatedNodeType.VALIDATOR
orEmulatedNodeType.AUDITOR
.
-
getValidatorId
public OptionalInt getValidatorId()
Returns a validator id if this node is a validator orOptionalInt.empty()
if this is an auditor node.
-
getServiceKeyPair
public KeyPair 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.
-
-