|
1 | 1 | package com.acrylplatform.api.grpc |
2 | | -import com.acrylplatform.account.PublicKey |
| 2 | + |
3 | 3 | import com.acrylplatform.api.common.CommonTransactionsApi |
4 | | -import com.acrylplatform.lang.ValidationError |
5 | | -import com.acrylplatform.protobuf.transaction.{InvokeScriptResult, PBSignedTransaction, PBTransaction, VanillaTransaction} |
| 4 | +import com.acrylplatform.protobuf.transaction.{InvokeScriptResult, PBSignedTransaction, VanillaTransaction} |
6 | 5 | import com.acrylplatform.state.{Blockchain, TransactionId} |
7 | 6 | import com.acrylplatform.transaction.AuthorizedTransaction |
8 | | -import com.acrylplatform.transaction.TxValidationError.GenericError |
9 | 7 | import com.acrylplatform.transaction.transfer.TransferTransaction |
10 | 8 | import com.acrylplatform.utx.UtxPool |
11 | 9 | import com.acrylplatform.wallet.Wallet |
12 | 10 | import io.grpc.stub.StreamObserver |
| 11 | +import io.grpc.{Status, StatusRuntimeException} |
13 | 12 | import monix.execution.Scheduler |
14 | 13 | import monix.reactive.Observable |
15 | 14 |
|
16 | 15 | import scala.concurrent.Future |
17 | | -import scala.util.Try |
18 | 16 |
|
19 | 17 | class TransactionsApiGrpcImpl(wallet: Wallet, |
20 | 18 | blockchain: Blockchain, |
@@ -67,17 +65,8 @@ class TransactionsApiGrpcImpl(wallet: Wallet, |
67 | 65 | responseObserver.completeWith(result) |
68 | 66 | } |
69 | 67 |
|
70 | | - override def sign(request: SignRequest): Future[PBSignedTransaction] = { |
71 | | - def signTransactionWith(tx: PBTransaction, wallet: Wallet, signerAddress: String): Either[ValidationError, PBSignedTransaction] = |
72 | | - for { |
73 | | - sender <- wallet.findPrivateKey(tx.sender.toString) |
74 | | - signer <- if (tx.sender.toString == signerAddress) Right(sender) else wallet.findPrivateKey(signerAddress) |
75 | | - tx <- Try(tx.signed(signer.privateKey)).toEither.left.map(GenericError(_)) |
76 | | - } yield tx |
77 | | - |
78 | | - val signerAddress: PublicKey = if (request.signerPublicKey.isEmpty) request.getTransaction.sender else request.signerPublicKey.toPublicKeyAccount |
79 | | - signTransactionWith(request.getTransaction, wallet, signerAddress.toString).toFuture |
80 | | - } |
| 68 | + override def sign(request: SignRequest): Future[PBSignedTransaction] = |
| 69 | + throw new StatusRuntimeException(Status.UNIMPLEMENTED) |
81 | 70 |
|
82 | 71 | override def broadcast(tx: PBSignedTransaction): Future[PBSignedTransaction] = { |
83 | 72 | commonApi |
|
0 commit comments