Skip to content

Commit

Permalink
Merge branch 'release/1.0.2' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ashalaginov committed Jan 8, 2024
2 parents c476326 + 3cfbf16 commit 4f94e28
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 26 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ junitBom=5.2.0
assertjVersion=3.20.2

# WE SDK libs
weNodeClientVersion=1.1.0
weNodeClientVersion=1.2.0
weContractSdkVersion=1.3.1

# GitHub properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class NodeServicesAutoConfiguration {
fun addressService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.addressService()

@Bean
@ConditionalOnMissingBean
fun aliasService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.aliasService()

@Bean
@ConditionalOnMissingBean
fun blocksService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
Expand All @@ -28,6 +33,16 @@ class NodeServicesAutoConfiguration {
fun nodeInfoService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.nodeInfoService()

@Bean
@ConditionalOnMissingBean
fun nodeUtilsService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.nodeUtilsService()

@Bean
@ConditionalOnMissingBean
fun pkiService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.pkiService()

@Bean
@ConditionalOnMissingBean
fun privacyService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
Expand All @@ -37,9 +52,4 @@ class NodeServicesAutoConfiguration {
@ConditionalOnMissingBean
fun txService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.txService()

@Bean
@ConditionalOnMissingBean
fun nodeUtilsService(nodeBlockingServiceFactory: NodeBlockingServiceFactory) =
nodeBlockingServiceFactory.nodeUtilsService()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package com.wavesenterprise.sdk.spring.autoconfigure.contract

import com.wavesenterprise.sdk.contract.client.invocation.factory.ContractBlockingClientFactory
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.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
Expand Down Expand Up @@ -144,24 +146,23 @@ class ContractBlockingClientFactoryConfigurationBootTest {
]
)
class TestConfig {
private val txService: TxService = mockk()
private val contractService: ContractService = mockk()
private val txSignerFactory: TxServiceTxSignerFactory = mockk()
private val txSigner: TxSigner = mockk()
private val addressService: AddressService = mockk()
private val aliasService: AliasService = mockk()
private val blocksService: BlocksService = mockk()
private val contractService: ContractService = mockk()
private val nodeInfoService: NodeInfoService = mockk()
private val privacyService: PrivacyService = mockk()
private val nodeUtilsService: NodeUtilsService = mockk()
private val pkiService: PkiService = mockk()
private val privacyService: PrivacyService = mockk()
private val txService: TxService = mockk()
private val txSigner: TxSigner = mockk()
private val txSignerFactory: TxServiceTxSignerFactory = mockk()

@Bean
fun txSigner(): TxSigner = txSigner

@Bean
fun txService(): TxService = txService
fun addressService(): AddressService = addressService

@Bean
fun addressService(): AddressService = addressService
fun aliasService(): AliasService = aliasService

@Bean
fun blocksService(): BlocksService = blocksService
Expand All @@ -172,24 +173,35 @@ class ContractBlockingClientFactoryConfigurationBootTest {
@Bean
fun nodeInfoService(): NodeInfoService = nodeInfoService

@Bean
fun nodeUtilsService(): NodeUtilsService = nodeUtilsService

@Bean
fun pkiService(): PkiService = pkiService

@Bean
fun privacyService(): PrivacyService = privacyService

@Bean
fun txSignerFactory(): TxServiceTxSignerFactory = txSignerFactory
fun txService(): TxService = txService

@Bean
fun nodeUtilsService(): NodeUtilsService = nodeUtilsService
fun txSigner(): TxSigner = txSigner

@Bean
fun txSignerFactory(): TxServiceTxSignerFactory = txSignerFactory

@Bean
fun nodeBlockingServiceFactory(): NodeBlockingServiceFactory = mockk<NodeBlockingServiceFactory>().also {
every { it.txService() } returns txService
every { it.addressService() } returns addressService
every { it.aliasService() } returns aliasService
every { it.blocksService() } returns blocksService
every { it.contractService() } returns contractService
every { it.nodeInfoService() } returns nodeInfoService
every { it.privacyService() } returns privacyService
every { it.nodeUtilsService() } returns nodeUtilsService
every { it.pkiService() } returns pkiService
every { it.privacyService() } returns privacyService
every { it.txService() } returns txService
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,15 @@ class ContractBlockingClientFactoryConfigurationTest {
class UserEnabledContractBeanInfoConfig {

val nodeBlockingServiceFactory: NodeBlockingServiceFactory = mockk<NodeBlockingServiceFactory>().also {
every { it.txService() } returns mockk()
every { it.addressService() } returns mockk()
every { it.aliasService() } returns mockk()
every { it.blocksService() } returns mockk()
every { it.contractService() } returns mockk()
every { it.nodeInfoService() } returns mockk()
every { it.nodeUtilsService() } returns mockk()
every { it.pkiService() } returns mockk()
every { it.privacyService() } returns mockk()
every { it.txService() } returns mockk()
}

val converterFactory: ConverterFactory = mockk<ConverterFactory>().also {
Expand Down Expand Up @@ -234,13 +237,15 @@ class ContractBlockingClientFactoryConfigurationTest {

@Bean("customNodeBlockingServiceFactory")
fun nodeBlockingServiceFactory(): NodeBlockingServiceFactory = mockk<NodeBlockingServiceFactory>().also {
every { it.txService() } returns mockk()
every { it.addressService() } returns mockk()
every { it.aliasService() } returns mockk()
every { it.blocksService() } returns mockk()
every { it.contractService() } returns mockk()
every { it.nodeInfoService() } returns mockk()
every { it.privacyService() } returns mockk()
every { it.nodeUtilsService() } returns mockk()
every { it.pkiService() } returns mockk()
every { it.privacyService() } returns mockk()
every { it.txService() } returns mockk()
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.wavesenterprise.sdk.spring.autoconfigure.node

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.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
Expand All @@ -28,12 +30,14 @@ class NodeServicesAutoConfigurationTest {
applicationContextRunner.withUserConfiguration(TestConfiguration::class.java)
.run { context ->
assertThat(context).hasSingleBean(AddressService::class.java)
assertThat(context).hasSingleBean(AliasService::class.java)
assertThat(context).hasSingleBean(BlocksService::class.java)
assertThat(context).hasSingleBean(ContractService::class.java)
assertThat(context).hasSingleBean(NodeInfoService::class.java)
assertThat(context).hasSingleBean(NodeUtilsService::class.java)
assertThat(context).hasSingleBean(PkiService::class.java)
assertThat(context).hasSingleBean(PrivacyService::class.java)
assertThat(context).hasSingleBean(TxService::class.java)
assertThat(context).hasSingleBean(NodeUtilsService::class.java)
}
}

Expand All @@ -42,13 +46,15 @@ class NodeServicesAutoConfigurationTest {

@Bean
fun nodeBlockingServiceFactory(): NodeBlockingServiceFactory = mockk<NodeBlockingServiceFactory>().also {
every { it.txService() } returns mockk()
every { it.addressService() } returns mockk()
every { it.aliasService() } returns mockk()
every { it.blocksService() } returns mockk()
every { it.contractService() } returns mockk()
every { it.nodeInfoService() } returns mockk()
every { it.privacyService() } returns mockk()
every { it.nodeUtilsService() } returns mockk()
every { it.pkiService() } returns mockk()
every { it.privacyService() } returns mockk()
every { it.txService() } returns mockk()
}
}
}

0 comments on commit 4f94e28

Please sign in to comment.