public class Instruction extends Object
| Constructor and Description |
|---|
Instruction(InstanceId instId,
byte[] nonce,
int index,
int length,
Delete delete)
Use this constructor if it is a delete instruction, i.e.
|
Instruction(InstanceId instId,
byte[] nonce,
int index,
int length,
Invoke invoke)
Use this constructor if it is an invoke instruction, i.e.
|
Instruction(InstanceId instId,
byte[] nonce,
int index,
int length,
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 an instance ID from the instruction with the given string.
|
InstanceId |
getInstId()
Getter for the object ID.
|
byte[] |
hash()
This method computes the sha256 hash of the instruction.
|
void |
setSignatures(List<Signature> signatures)
Setter for the signatures.
|
void |
signBy(List<Signer> signers)
Have a list of signers sign the instruction.
|
Request |
toDarcRequest()
Converts the instruction to a Darc request representation.
|
OmniLedgerProto.Instruction |
toProto()
Converts this object to the protobuf representation.
|
public Instruction(InstanceId instId, byte[] nonce, int index, int length, Spawn spawn)
instId - The ID of the object, which must be unique.nonce - The nonce of the object.index - The index of the instruction in the atomic set.length - The length of the atomic set.spawn - The spawn object, which contains the value and the argument.public Instruction(InstanceId instId, byte[] nonce, int index, int length, Invoke invoke)
instId - The ID of the object, which must be unique.nonce - The nonce of the object.index - The index of the instruction in the atomic set.length - The length of the atomic set.invoke - The invoke object.public Instruction(InstanceId instId, byte[] nonce, int index, int length, Delete delete)
instId - The ID of the object, which must be unique.nonce - The nonce of the object.index - The index of the instruction in the atomic set.length - The length of the atomic set.delete - The delete object.public InstanceId getInstId()
public byte[] hash()
public OmniLedgerProto.Instruction toProto()
public String action()
public Request toDarcRequest()
public void signBy(List<Signer> signers) throws CothorityCryptoException
signers - - the list of signers.CothorityCryptoExceptionpublic InstanceId deriveId(String what) throws CothorityCryptoException
what - - the string that gets mixed into the derived instance IDCothorityCryptoExceptionCopyright © 2018. All rights reserved.