mirror of
https://github.com/corda/corda.git
synced 2025-06-18 15:18:16 +00:00
Minor changes to address PR feedback and comments
This commit is contained in:
@ -77,10 +77,6 @@ class NodeVaultService(private val services: ServiceHub) : SingletonSerializeAsT
|
||||
}
|
||||
}
|
||||
|
||||
fun allTransactionNotes(): Map<SecureHash,Set<String>> {
|
||||
return transactionNotes
|
||||
}
|
||||
|
||||
val _updatesPublisher = PublishSubject.create<Vault.Update>()
|
||||
|
||||
fun allUnconsumedStates(): Iterable<StateAndRef<ContractState>> {
|
||||
@ -104,14 +100,14 @@ class NodeVaultService(private val services: ServiceHub) : SingletonSerializeAsT
|
||||
}
|
||||
})
|
||||
|
||||
override val currentVault: Vault get() = mutex.locked { Vault(allUnconsumedStates(), allTransactionNotes()) }
|
||||
override val currentVault: Vault get() = mutex.locked { Vault(allUnconsumedStates(), transactionNotes) }
|
||||
|
||||
override val updates: Observable<Vault.Update>
|
||||
get() = mutex.locked { _updatesPublisher }
|
||||
|
||||
override fun track(): Pair<Vault, Observable<Vault.Update>> {
|
||||
return mutex.locked {
|
||||
Pair(Vault(allUnconsumedStates(), allTransactionNotes()), _updatesPublisher.bufferUntilSubscribed())
|
||||
Pair(Vault(allUnconsumedStates(), transactionNotes), _updatesPublisher.bufferUntilSubscribed())
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,7 +131,6 @@ class NodeVaultService(private val services: ServiceHub) : SingletonSerializeAsT
|
||||
return currentVault
|
||||
}
|
||||
|
||||
|
||||
override fun addNoteToTransaction(txnId: SecureHash, noteText: String) {
|
||||
mutex.locked {
|
||||
val notes = transactionNotes.getOrPut(key = txnId, defaultValue = {
|
||||
@ -300,5 +295,4 @@ class NodeVaultService(private val services: ServiceHub) : SingletonSerializeAsT
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ class NodeVaultServiceTest {
|
||||
|
||||
@Test
|
||||
fun addNoteToTransaction() {
|
||||
|
||||
databaseTransaction(database) {
|
||||
val services = object : MockServices() {
|
||||
override val vaultService: VaultService = NodeVaultService(this)
|
||||
|
Reference in New Issue
Block a user