mirror of
https://github.com/corda/corda.git
synced 2025-05-02 16:53:22 +00:00
Exposed Vault Transaction Note functionality via RPC.
This commit is contained in:
parent
c5500caf98
commit
74dc0b7154
@ -4,6 +4,7 @@ import com.r3corda.contracts.asset.Cash
|
|||||||
import com.r3corda.core.contracts.InsufficientBalanceException
|
import com.r3corda.core.contracts.InsufficientBalanceException
|
||||||
import com.r3corda.core.contracts.*
|
import com.r3corda.core.contracts.*
|
||||||
import com.r3corda.core.crypto.Party
|
import com.r3corda.core.crypto.Party
|
||||||
|
import com.r3corda.core.crypto.SecureHash
|
||||||
import com.r3corda.core.crypto.toStringShort
|
import com.r3corda.core.crypto.toStringShort
|
||||||
import com.r3corda.core.node.NodeInfo
|
import com.r3corda.core.node.NodeInfo
|
||||||
import com.r3corda.core.node.ServiceHub
|
import com.r3corda.core.node.ServiceHub
|
||||||
@ -74,6 +75,18 @@ class ServerRPCOps(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun addVaultTransactionNote(txnId: SecureHash, txnNote: String) {
|
||||||
|
return databaseTransaction(database) {
|
||||||
|
services.vaultService.addNoteToTransaction(txnId, txnNote)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getVaultTransactionNotes(txnId: SecureHash): Iterable<String> {
|
||||||
|
return databaseTransaction(database) {
|
||||||
|
services.vaultService.getTransactionNotes(txnId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Make a lightweight protocol that manages this workflow, rather than embedding it directly in the service
|
// TODO: Make a lightweight protocol that manages this workflow, rather than embedding it directly in the service
|
||||||
private fun initiatePayment(req: ClientToServiceCommand.PayCash): TransactionBuildResult {
|
private fun initiatePayment(req: ClientToServiceCommand.PayCash): TransactionBuildResult {
|
||||||
val builder: TransactionBuilder = TransactionType.General.Builder(null)
|
val builder: TransactionBuilder = TransactionType.General.Builder(null)
|
||||||
|
@ -3,6 +3,7 @@ package com.r3corda.node.services.messaging
|
|||||||
import com.r3corda.core.contracts.ClientToServiceCommand
|
import com.r3corda.core.contracts.ClientToServiceCommand
|
||||||
import com.r3corda.core.contracts.ContractState
|
import com.r3corda.core.contracts.ContractState
|
||||||
import com.r3corda.core.contracts.StateAndRef
|
import com.r3corda.core.contracts.StateAndRef
|
||||||
|
import com.r3corda.core.crypto.SecureHash
|
||||||
import com.r3corda.core.node.NodeInfo
|
import com.r3corda.core.node.NodeInfo
|
||||||
import com.r3corda.core.node.services.NetworkMapCache
|
import com.r3corda.core.node.services.NetworkMapCache
|
||||||
import com.r3corda.core.node.services.StateMachineTransactionMapping
|
import com.r3corda.core.node.services.StateMachineTransactionMapping
|
||||||
@ -116,4 +117,14 @@ interface CordaRPCOps : RPCOps {
|
|||||||
* TODO: The signature of this is weird because it's the remains of an old service call, we should have a call for each command instead.
|
* TODO: The signature of this is weird because it's the remains of an old service call, we should have a call for each command instead.
|
||||||
*/
|
*/
|
||||||
fun executeCommand(command: ClientToServiceCommand): TransactionBuildResult
|
fun executeCommand(command: ClientToServiceCommand): TransactionBuildResult
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add note(s) to an existing Vault transaction
|
||||||
|
*/
|
||||||
|
fun addVaultTransactionNote(txnId: SecureHash, txnNote: String)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Retrieve existing note(s) for a given Vault transaction
|
||||||
|
*/
|
||||||
|
fun getVaultTransactionNotes(txnId: SecureHash): Iterable<String>
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import com.google.common.net.HostAndPort
|
|||||||
import com.r3corda.core.contracts.ClientToServiceCommand
|
import com.r3corda.core.contracts.ClientToServiceCommand
|
||||||
import com.r3corda.core.contracts.ContractState
|
import com.r3corda.core.contracts.ContractState
|
||||||
import com.r3corda.core.contracts.StateAndRef
|
import com.r3corda.core.contracts.StateAndRef
|
||||||
|
import com.r3corda.core.crypto.SecureHash
|
||||||
import com.r3corda.core.crypto.generateKeyPair
|
import com.r3corda.core.crypto.generateKeyPair
|
||||||
import com.r3corda.core.messaging.Message
|
import com.r3corda.core.messaging.Message
|
||||||
import com.r3corda.core.messaging.createMessage
|
import com.r3corda.core.messaging.createMessage
|
||||||
@ -84,6 +85,13 @@ class ArtemisMessagingTests {
|
|||||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun addVaultTransactionNote(txnId: SecureHash, txnNote: String) {
|
||||||
|
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getVaultTransactionNotes(txnId: SecureHash): Iterable<String> {
|
||||||
|
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
Loading…
x
Reference in New Issue
Block a user