-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGrpcNodeServiceFactory.kt
76 lines (64 loc) · 2.86 KB
/
GrpcNodeServiceFactory.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.wavesenterprise.sdk.node.client.grpc.blocking.factory
import com.wavesenterprise.protobuf.service.contract.ContractServiceGrpc
import com.wavesenterprise.protobuf.service.messagebroker.BlockchainEventsServiceGrpc
import com.wavesenterprise.sdk.node.client.blocking.address.AddressService
import com.wavesenterprise.sdk.node.client.blocking.alias.AliasService
import com.wavesenterprise.sdk.node.client.blocking.blocks.BlocksService
import com.wavesenterprise.sdk.node.client.blocking.contract.ContractService
import com.wavesenterprise.sdk.node.client.blocking.event.BlockchainEventsService
import com.wavesenterprise.sdk.node.client.blocking.node.NodeBlockingServiceFactory
import com.wavesenterprise.sdk.node.client.blocking.node.NodeInfoService
import com.wavesenterprise.sdk.node.client.blocking.pki.PkiService
import com.wavesenterprise.sdk.node.client.blocking.privacy.PrivacyService
import com.wavesenterprise.sdk.node.client.blocking.tx.TxService
import com.wavesenterprise.sdk.node.client.blocking.util.NodeUtilsService
import com.wavesenterprise.sdk.node.client.grpc.blocking.contract.ContractGrpcBlockingService
import com.wavesenterprise.sdk.node.client.grpc.blocking.event.BlockchainEventsGrpcBlockingService
import com.wavesenterprise.sdk.node.client.grpc.blocking.tx.TxGrpcBlockingService
import io.grpc.Channel
import io.grpc.ClientInterceptor
class GrpcNodeServiceFactory(
private val clientInterceptors: List<ClientInterceptor>,
private val channel: Channel,
) : NodeBlockingServiceFactory {
override fun addressService(): AddressService {
TODO("Not yet implemented")
}
override fun aliasService(): AliasService {
TODO("Not yet implemented")
}
override fun blockchainEventsService(): BlockchainEventsService =
BlockchainEventsGrpcBlockingService(
channel = channel,
grpc = BlockchainEventsServiceGrpc.newBlockingStub(channel),
)
override fun blocksService(): BlocksService {
TODO("Not yet implemented")
}
@Suppress("SpreadOperator")
override fun contractService(): ContractService {
return ContractGrpcBlockingService(
channel = channel,
clientInterceptors = clientInterceptors,
contractServiceStub = ContractServiceGrpc
.newBlockingStub(channel).withInterceptors(*clientInterceptors.toTypedArray()),
)
}
override fun nodeInfoService(): NodeInfoService {
TODO("Not yet implemented")
}
override fun nodeUtilsService(): NodeUtilsService {
TODO("Not yet implemented")
}
override fun pkiService(): PkiService {
TODO("Not yet implemented")
}
override fun privacyService(): PrivacyService {
TODO("Not yet implemented")
}
override fun txService(): TxService {
return TxGrpcBlockingService(
channel = channel,
)
}
}