mirror of
https://github.com/corda/corda.git
synced 2025-05-29 21:54:26 +00:00
Minor: a couple of small usability improvements to TransactionBuilder
This commit is contained in:
parent
c60c333ba9
commit
b8dc755926
@ -81,6 +81,7 @@ open class TransactionBuilder(
|
|||||||
is TransactionState<*> -> addOutputState(t)
|
is TransactionState<*> -> addOutputState(t)
|
||||||
is ContractState -> addOutputState(t)
|
is ContractState -> addOutputState(t)
|
||||||
is Command -> addCommand(t)
|
is Command -> addCommand(t)
|
||||||
|
is CommandData -> throw IllegalArgumentException("You passed an instance of CommandData, but that lacks the pubkey. You need to wrap it in a Command object first.")
|
||||||
else -> throw IllegalArgumentException("Wrong argument type: ${t.javaClass}")
|
else -> throw IllegalArgumentException("Wrong argument type: ${t.javaClass}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,8 +121,9 @@ open class TransactionBuilder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Adds the signature directly to the transaction, without checking it for validity. */
|
/** Adds the signature directly to the transaction, without checking it for validity. */
|
||||||
fun addSignatureUnchecked(sig: DigitalSignature.WithKey) {
|
fun addSignatureUnchecked(sig: DigitalSignature.WithKey): TransactionBuilder {
|
||||||
currentSigs.add(sig)
|
currentSigs.add(sig)
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toWireTransaction() = WireTransaction(ArrayList(inputs), ArrayList(attachments),
|
fun toWireTransaction() = WireTransaction(ArrayList(inputs), ArrayList(attachments),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user