Skip to content

Commit

Permalink
Merge branch 'feature/WTCH-97' into 'dev'
Browse files Browse the repository at this point in the history
[WTCH-97] Add TxSignerFactory

Closes WTCH-97

See merge request waves-enterprise/java-sdk/we-node-client!13
  • Loading branch information
Daniil Georgiev committed Oct 5, 2022
2 parents 0170ebc + 71412f3 commit 2f20666
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FeignTxService(
override fun txInfo(txId: TxId): Optional<TxInfo> =
weTxApiFeign.txInfo(txId.asBase58String()).map {
TxInfo(
height = Height(requireNotNull(it.height) { "Height should be present when getting txInfo" }),
height = Height(checkNotNull(it.height) { "Height should be present when getting txInfo" }),
tx = it.toDomain()
)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.wavesenterprise.sdk.tx.signer.node.factory

import com.wavesenterprise.sdk.node.domain.blocking.tx.TxService
import com.wavesenterprise.sdk.tx.signer.TxSigner
import com.wavesenterprise.sdk.tx.signer.node.TxServiceTxSigner
import com.wavesenterprise.sdk.tx.signer.node.credentials.Credentials
import com.wavesenterprise.sdk.tx.signer.node.credentials.DefaultSignCredentialsProvider

class TxServiceTxSignerFactory(
private val txService: TxService,
) {
fun withCredentials(credentials: Credentials): TxSigner =
TxServiceTxSigner(
txService = txService,
signCredentialsProvider = DefaultSignCredentialsProvider(credentials),
)
}

0 comments on commit 2f20666

Please sign in to comment.