mirror of
https://github.com/corda/corda.git
synced 2025-06-18 07:08:15 +00:00
Deprecating verifiedTransactions from the public API (#1418)
This commit is contained in:
@ -89,7 +89,7 @@ class NodeMonitorModel {
|
|||||||
vaultUpdates.startWith(initialVaultUpdate).subscribe(vaultUpdatesSubject)
|
vaultUpdates.startWith(initialVaultUpdate).subscribe(vaultUpdatesSubject)
|
||||||
|
|
||||||
// Transactions
|
// Transactions
|
||||||
val (transactions, newTransactions) = proxy.verifiedTransactionsFeed()
|
val (transactions, newTransactions) = proxy.internalVerifiedTransactionsFeed()
|
||||||
newTransactions.startWith(transactions).subscribe(transactionsSubject)
|
newTransactions.startWith(transactions).subscribe(transactionsSubject)
|
||||||
|
|
||||||
// SM -> TX mapping
|
// SM -> TX mapping
|
||||||
|
@ -157,15 +157,21 @@ interface CordaRPCOps : RPCOps {
|
|||||||
// DOCEND VaultTrackAPIHelpers
|
// DOCEND VaultTrackAPIHelpers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of all recorded transactions.
|
* @suppress Returns a list of all recorded transactions.
|
||||||
|
*
|
||||||
|
* TODO This method should be removed once SGX work is finalised and the design of the corresponding API using [FilteredTransaction] can be started
|
||||||
*/
|
*/
|
||||||
fun verifiedTransactionsSnapshot(): List<SignedTransaction>
|
@Deprecated("This method is intended only for internal use and will be removed from the public API soon.")
|
||||||
|
fun internalVerifiedTransactionsSnapshot(): List<SignedTransaction>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a data feed of all recorded transactions and an observable of future recorded ones.
|
* @suppress Returns a data feed of all recorded transactions and an observable of future recorded ones.
|
||||||
|
*
|
||||||
|
* TODO This method should be removed once SGX work is finalised and the design of the corresponding API using [FilteredTransaction] can be started
|
||||||
*/
|
*/
|
||||||
|
@Deprecated("This method is intended only for internal use and will be removed from the public API soon.")
|
||||||
@RPCReturnsObservables
|
@RPCReturnsObservables
|
||||||
fun verifiedTransactionsFeed(): DataFeed<List<SignedTransaction>, SignedTransaction>
|
fun internalVerifiedTransactionsFeed(): DataFeed<List<SignedTransaction>, SignedTransaction>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a snapshot list of existing state machine id - recorded transaction hash mappings.
|
* Returns a snapshot list of existing state machine id - recorded transaction hash mappings.
|
||||||
|
@ -63,7 +63,7 @@ fun main(args: Array<String>) {
|
|||||||
// END 2
|
// END 2
|
||||||
|
|
||||||
// START 3
|
// START 3
|
||||||
val (transactions: List<SignedTransaction>, futureTransactions: Observable<SignedTransaction>) = proxy.verifiedTransactionsFeed()
|
val (transactions: List<SignedTransaction>, futureTransactions: Observable<SignedTransaction>) = proxy.internalVerifiedTransactionsFeed()
|
||||||
// END 3
|
// END 3
|
||||||
|
|
||||||
// START 4
|
// START 4
|
||||||
|
@ -71,13 +71,13 @@ class CordaRPCOpsImpl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun verifiedTransactionsSnapshot(): List<SignedTransaction> {
|
override fun internalVerifiedTransactionsSnapshot(): List<SignedTransaction> {
|
||||||
val (snapshot, updates) = verifiedTransactionsFeed()
|
val (snapshot, updates) = internalVerifiedTransactionsFeed()
|
||||||
updates.notUsed()
|
updates.notUsed()
|
||||||
return snapshot
|
return snapshot
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun verifiedTransactionsFeed(): DataFeed<List<SignedTransaction>, SignedTransaction> {
|
override fun internalVerifiedTransactionsFeed(): DataFeed<List<SignedTransaction>, SignedTransaction> {
|
||||||
return database.transaction {
|
return database.transaction {
|
||||||
services.validatedTransactions.track()
|
services.validatedTransactions.track()
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ class CordaRPCOpsImplTest {
|
|||||||
fun `issue and move`() {
|
fun `issue and move`() {
|
||||||
aliceNode.database.transaction {
|
aliceNode.database.transaction {
|
||||||
stateMachineUpdates = rpc.stateMachinesFeed().updates
|
stateMachineUpdates = rpc.stateMachinesFeed().updates
|
||||||
transactions = rpc.verifiedTransactionsFeed().updates
|
transactions = rpc.internalVerifiedTransactionsFeed().updates
|
||||||
vaultTrackCash = rpc.vaultTrackBy<Cash.State>().updates
|
vaultTrackCash = rpc.vaultTrackBy<Cash.State>().updates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class AttachmentDemoFlow(val otherSide: Party, val notary: Party, val hash: Secu
|
|||||||
|
|
||||||
fun recipient(rpc: CordaRPCOps) {
|
fun recipient(rpc: CordaRPCOps) {
|
||||||
println("Waiting to receive transaction ...")
|
println("Waiting to receive transaction ...")
|
||||||
val stx = rpc.verifiedTransactionsFeed().updates.toBlocking().first()
|
val stx = rpc.internalVerifiedTransactionsFeed().updates.toBlocking().first()
|
||||||
val wtx = stx.tx
|
val wtx = stx.tx
|
||||||
if (wtx.attachments.isNotEmpty()) {
|
if (wtx.attachments.isNotEmpty()) {
|
||||||
if (wtx.outputs.isNotEmpty()) {
|
if (wtx.outputs.isNotEmpty()) {
|
||||||
|
@ -187,7 +187,7 @@ class NodeTerminalView : Fragment() {
|
|||||||
|
|
||||||
private fun initialise(config: NodeConfig, ops: CordaRPCOps) {
|
private fun initialise(config: NodeConfig, ops: CordaRPCOps) {
|
||||||
try {
|
try {
|
||||||
val (txInit, txNext) = ops.verifiedTransactionsFeed()
|
val (txInit, txNext) = ops.internalVerifiedTransactionsFeed()
|
||||||
val (stateInit, stateNext) = ops.vaultTrackBy<ContractState>(paging = pageSpecification)
|
val (stateInit, stateNext) = ops.vaultTrackBy<ContractState>(paging = pageSpecification)
|
||||||
|
|
||||||
txCount = txInit.size
|
txCount = txInit.size
|
||||||
|
Reference in New Issue
Block a user