mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Commands must have at least one pubkey.
This commit is contained in:
@ -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 */
|
/** 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>) {
|
data class Command(val data: CommandData, val pubkeys: List<PublicKey>) {
|
||||||
|
init {
|
||||||
|
require(pubkeys.isNotEmpty())
|
||||||
|
}
|
||||||
constructor(data: CommandData, key: PublicKey) : this(data, listOf(key))
|
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
|
* 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 {
|
data class TimestampCommand(val after: Instant?, val before: Instant?) : CommandData {
|
||||||
init {
|
init {
|
||||||
|
@ -75,7 +75,7 @@ class CashTests {
|
|||||||
transaction {
|
transaction {
|
||||||
input { DummyContract.State() }
|
input { DummyContract.State() }
|
||||||
output { outState }
|
output { outState }
|
||||||
arg { Cash.Commands.Move() }
|
arg(MINI_CORP_PUBKEY) { Cash.Commands.Move() }
|
||||||
|
|
||||||
this `fails requirement` "there is at least one cash input"
|
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.
|
// institution is allowed to issue as much cash as they want.
|
||||||
transaction {
|
transaction {
|
||||||
output { outState }
|
output { outState }
|
||||||
arg { Cash.Commands.Issue() }
|
arg(DUMMY_PUBKEY_1) { Cash.Commands.Issue() }
|
||||||
this `fails requirement` "output deposits are owned by a command signer"
|
this `fails requirement` "output deposits are owned by a command signer"
|
||||||
}
|
}
|
||||||
transaction {
|
transaction {
|
||||||
|
Reference in New Issue
Block a user