Hide private variables

This commit is contained in:
Carter Jernigan 2023-01-30 14:47:10 -05:00
parent f089fb5424
commit b8be2a234f
2 changed files with 7 additions and 6 deletions

View File

@ -154,9 +154,9 @@ internal class BlockingLightWalletClientImpl private constructor(
channel = channelFactory.newChannel(lightWalletEndpoint)
}
// test code
internal var stateCount = 0
internal var state: ConnectivityState? = null
// These make the implementation of BlockingLightWalletClientImpl not thread-safe.
private var stateCount = 0
private var state: ConnectivityState? = null
private fun requireChannel(): ManagedChannel {
state = channel.getState(false).let { new ->
if (state == new) stateCount++ else stateCount = 0

View File

@ -154,9 +154,10 @@ internal class CoroutineLightWalletClientImpl private constructor(
channel = channelFactory.newChannel(lightWalletEndpoint)
}
// test code
internal var stateCount = 0
internal var state: ConnectivityState? = null
// These make the CoroutineLightWalletClientImpl not thread safe. In the long-term, we should
// consider making it thread safe.
private var stateCount = 0
private var state: ConnectivityState? = null
private fun requireChannel(): ManagedChannel {
state = channel.getState(false).let { new ->
if (state == new) stateCount++ else stateCount = 0