public class Instruction extends Object
| Constructor and Description |
|---|
Instruction(ByzCoinProto.Instruction inst)
Construct Instruction from its protobuf representation.
|
Instruction(InstanceId instId,
List<Identity> ids,
List<Long> ctrs,
Delete delete)
Use this constructor if it is a delete instruction, i.e.
|
Instruction(InstanceId instId,
List<Identity> ids,
List<Long> ctrs,
Invoke invoke)
Use this constructor if it is an invoke instruction, i.e.
|
Instruction(InstanceId instId,
List<Identity> ids,
List<Long> ctrs,
Spawn spawn)
Use this constructor if it is a spawn instruction, i.e.
|
| Modifier and Type | Method and Description |
|---|---|
String |
action()
Outputs the action of the instruction, this action be the same as an action in the corresponding darc.
|
InstanceId |
deriveId(String what)
This function derives a contract ID from the instruction with the given string.
|
Delete |
getDelete()
Getter for the delete argument.
|
InstanceId |
getInstanceId()
Getter for the instance ID.
|
Invoke |
getInvoke()
Getter for the invoke argument.
|
List<byte[]> |
getSignatures()
Getter for the signatures.
|
List<Long> |
getSignerCounters()
Getter for signer counters.
|
List<Identity> |
getSignerIdentities()
Getter for signer identities.
|
Spawn |
getSpawn()
Getter for the spawn argument.
|
byte[] |
hash()
This method computes the sha256 hash of the instruction.
|
void |
setSignatures(List<byte[]> signatures)
Setter for the signatures.
|
void |
setSignerCounters(List<Long> signerCounters)
Setter for the signer counters, they must map to the signers in the signature.
|
void |
setSignerIdentities(List<Identity> signerIdentities) |
void |
signWith(byte[] ctxHash,
List<Signer> signers)
Have a list of signers sign the instruction.
|
ByzCoinProto.Instruction |
toProto()
Converts this object to the protobuf representation.
|
String |
toString() |
public Instruction(InstanceId instId, List<Identity> ids, List<Long> ctrs, Spawn spawn)
instId - The instance ID.ids - The identities of all the signers.ctrs - The list of monotonically increasing counter for those that will eventually sign the instruction.spawn - The spawn object, which contains the value and the argument.public Instruction(InstanceId instId, List<Identity> ids, List<Long> ctrs, Invoke invoke)
instId - The ID of the object, which must be unique.ids - The identities of all the signers.ctrs - The list of monotonically increasing counter for those that will eventually sign the instruction.invoke - The invoke object.public Instruction(InstanceId instId, List<Identity> ids, List<Long> ctrs, Delete delete)
instId - The ID of the object, which must be unique.ids - The identities of all the signers.ctrs - The list of monotonically increasing counter for those that will eventually sign the instruction.delete - The delete object.public Instruction(ByzCoinProto.Instruction inst)
inst - the protobuf representation of the instructionpublic List<byte[]> getSignatures()
public InstanceId getInstanceId()
public Spawn getSpawn()
public Invoke getInvoke()
public Delete getDelete()
public void setSignerCounters(List<Long> signerCounters)
signerCounters - the list of counterspublic void setSignatures(List<byte[]> signatures)
signatures - the signatures to setpublic byte[] hash()
public ByzCoinProto.Instruction toProto()
public String action()
public void signWith(byte[] ctxHash,
List<Signer> signers)
throws CothorityCryptoException
ctxHash - - the hash of all instruction in the client transactionsigners - - the list of signers.CothorityCryptoException - if there's a problem with the cryptographypublic InstanceId deriveId(String what)
what - - the string that gets mixed into the derived instance IDCopyright © 2019. All rights reserved.