mirror of
https://github.com/corda/corda.git
synced 2025-02-21 01:42:24 +00:00
Commands must have at least one pubkey.
This commit is contained in:
parent
992b56a2b2
commit
0d0e75e6ff
@ -75,6 +75,9 @@ abstract class TypeOnlyCommandData : CommandData {
|
||||
|
||||
/** Command data/content plus pubkey pair: the signature is stored at the end of the serialized bytes */
|
||||
data class Command(val data: CommandData, val pubkeys: List<PublicKey>) {
|
||||
init {
|
||||
require(pubkeys.isNotEmpty())
|
||||
}
|
||||
constructor(data: CommandData, key: PublicKey) : this(data, listOf(key))
|
||||
}
|
||||
|
||||
@ -88,7 +91,7 @@ data class AuthenticatedObject<out T : Any>(
|
||||
|
||||
/**
|
||||
* If present in a transaction, contains a time that was verified by the timestamping authority/authorities whose
|
||||
* public keys are identified in the containing [Command] object.
|
||||
* public keys are identified in the containing [Command] object. The true time must be between (after, before)
|
||||
*/
|
||||
data class TimestampCommand(val after: Instant?, val before: Instant?) : CommandData {
|
||||
init {
|
||||
|
@ -75,7 +75,7 @@ class CashTests {
|
||||
transaction {
|
||||
input { DummyContract.State() }
|
||||
output { outState }
|
||||
arg { Cash.Commands.Move() }
|
||||
arg(MINI_CORP_PUBKEY) { Cash.Commands.Move() }
|
||||
|
||||
this `fails requirement` "there is at least one cash input"
|
||||
}
|
||||
@ -84,7 +84,7 @@ class CashTests {
|
||||
// institution is allowed to issue as much cash as they want.
|
||||
transaction {
|
||||
output { outState }
|
||||
arg { Cash.Commands.Issue() }
|
||||
arg(DUMMY_PUBKEY_1) { Cash.Commands.Issue() }
|
||||
this `fails requirement` "output deposits are owned by a command signer"
|
||||
}
|
||||
transaction {
|
||||
|
Loading…
x
Reference in New Issue
Block a user