Minor: TimestamperNodeService -> NodeTimestamperService for consistency

This commit is contained in:
Mike Hearn 2016-03-08 12:01:49 +01:00
parent 8d041a6b1a
commit 2c4475b0d9
4 changed files with 12 additions and 12 deletions

View File

@ -79,7 +79,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
lateinit var smm: StateMachineManager
lateinit var wallet: WalletService
lateinit var keyManagement: E2ETestKeyManagementService
var inNodeTimestampingService: TimestamperNodeService? = null
var inNodeTimestampingService: NodeTimestamperService? = null
lateinit var identity: IdentityService
lateinit var net: MessagingService
@ -97,7 +97,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
inNodeTimestampingService = null
timestamperAddress
} else {
inNodeTimestampingService = TimestamperNodeService(net, storage.myLegalIdentity, storage.myLegalIdentityKey)
inNodeTimestampingService = NodeTimestamperService(net, storage.myLegalIdentity, storage.myLegalIdentityKey)
LegallyIdentifiableNode(net.myAddress, storage.myLegalIdentity)
}
(services.networkMapService as MockNetworkMap).timestampingNodes.add(tsid)

View File

@ -39,7 +39,7 @@ class TimestampingMessages {
* See the doc site to learn more about timestamping authorities (nodes) and the role they play in the data model.
*/
@ThreadSafe
class TimestamperNodeService(private val net: MessagingService,
class NodeTimestamperService(private val net: MessagingService,
val identity: Party,
val signingKey: KeyPair,
val clock: Clock = Clock.systemDefaultZone(),
@ -47,7 +47,7 @@ class TimestamperNodeService(private val net: MessagingService,
companion object {
val TIMESTAMPING_PROTOCOL_TOPIC = "platform.timestamping.request"
private val logger = LoggerFactory.getLogger(TimestamperNodeService::class.java)
private val logger = LoggerFactory.getLogger(NodeTimestamperService::class.java)
}
init {
@ -97,7 +97,7 @@ class TimestamperNodeService(private val net: MessagingService,
}
/**
* The TimestampingProtocol class is the client code that talks to a [TimestamperNodeService] on some remote node. It is a
* The TimestampingProtocol class is the client code that talks to a [NodeTimestamperService] on some remote node. It is a
* [ProtocolLogic], meaning it can either be a sub-protocol of some other protocol, or be driven independently.
*
* If you are not yourself authoring a protocol and want to timestamp something, the [TimestampingProtocol.Client] class
@ -120,11 +120,11 @@ class TimestampingProtocol(private val node: LegallyIdentifiableNode,
@Suspendable
override fun call(): DigitalSignature.LegallyIdentifiable {
val sessionID = random63BitValue()
val replyTopic = "${TimestamperNodeService.TIMESTAMPING_PROTOCOL_TOPIC}.$sessionID"
val replyTopic = "${NodeTimestamperService.TIMESTAMPING_PROTOCOL_TOPIC}.$sessionID"
val req = TimestampingMessages.Request(wtxBytes, serviceHub.networkService.myAddress, replyTopic)
val maybeSignature = sendAndReceive<DigitalSignature.LegallyIdentifiable>(
TimestamperNodeService.TIMESTAMPING_PROTOCOL_TOPIC, node.address, 0, sessionID, req)
NodeTimestamperService.TIMESTAMPING_PROTOCOL_TOPIC, node.address, 0, sessionID, req)
// Check that the timestamping authority gave us back a valid signature and didn't break somehow
maybeSignature.validate { sig ->

View File

@ -14,7 +14,7 @@ import com.google.common.util.concurrent.MoreExecutors
import core.node.services.DummyTimestampingAuthority
import core.ThreadBox
import core.crypto.sha256
import core.node.services.TimestamperNodeService
import core.node.services.NodeTimestamperService
import core.utilities.loggerFor
import java.time.Instant
import java.util.*
@ -126,7 +126,7 @@ class InMemoryMessagingNetwork {
check(timestampingAdvert == null)
val (handle, builder) = createNode(manuallyPumped)
val node = builder.start().get()
TimestamperNodeService(node, DummyTimestampingAuthority.identity, DummyTimestampingAuthority.key)
NodeTimestamperService(node, DummyTimestampingAuthority.identity, DummyTimestampingAuthority.key)
timestampingAdvert = LegallyIdentifiableNode(handle, DummyTimestampingAuthority.identity)
return Pair(timestampingAdvert!!, node)
}

View File

@ -33,7 +33,7 @@ import kotlin.test.assertTrue
class TimestamperNodeServiceTest : TestWithInMemoryNetwork() {
lateinit var myMessaging: Pair<InMemoryMessagingNetwork.Handle, InMemoryMessagingNetwork.InMemoryMessaging>
lateinit var serviceMessaging: Pair<InMemoryMessagingNetwork.Handle, InMemoryMessagingNetwork.InMemoryMessaging>
lateinit var service: TimestamperNodeService
lateinit var service: NodeTimestamperService
val ptx = TransactionBuilder().apply {
addInputState(StateRef(SecureHash.randomSHA256(), 0))
@ -59,7 +59,7 @@ class TimestamperNodeServiceTest : TestWithInMemoryNetwork() {
serverKey = timestampingNodeID.identity.owningKey
// And a separate one to be tested directly, to make the unit tests a bit faster.
service = TimestamperNodeService(serviceMessaging.second, Party("Unit test suite", ALICE), ALICE_KEY)
service = NodeTimestamperService(serviceMessaging.second, Party("Unit test suite", ALICE), ALICE_KEY)
}
class TestPSM(val server: LegallyIdentifiableNode, val now: Instant) : ProtocolLogic<Boolean>() {
@ -82,7 +82,7 @@ class TimestamperNodeServiceTest : TestWithInMemoryNetwork() {
fun successWithNetwork() {
val psm = runNetwork {
val smm = StateMachineManager(MockServices(net = myMessaging.second), RunOnCallerThread)
val logName = TimestamperNodeService.TIMESTAMPING_PROTOCOL_TOPIC
val logName = NodeTimestamperService.TIMESTAMPING_PROTOCOL_TOPIC
val psm = TestPSM(mockServices.networkMapService.timestampingNodes[0], clock.instant())
smm.add(logName, psm)
}