@Immutable public class ContractExecutionRequest extends AbstractRequest
Constructor and Description |
---|
ContractExecutionRequest(java.lang.String nonce,
java.lang.String entityId,
int keyVersion,
java.lang.String contractId,
java.lang.String contractArgument,
java.util.List<java.lang.String> functionIds,
java.lang.String functionArgument,
byte[] signature,
byte[] auditorSignature)
Constructs a
ContractExecutionRequest with the specified nonce, contract id, argument,
entity ID, key version, a list of AssetProof and signature of the request. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this object.
|
byte[] |
getAuditorSignature()
Returns the signature from an auditor
|
java.lang.String |
getContractArgument()
Returns the argument to a contract.
|
java.lang.String |
getContractId()
Returns the contract id of a contract.
|
java.util.Optional<java.lang.String> |
getFunctionArgument()
Returns the argument to user-defined functions
|
java.util.List<java.lang.String> |
getFunctionIds()
Returns a list of function ids.
|
java.lang.String |
getNonce()
Returns the nonce value of the request.
|
byte[] |
getSignature()
Returns the signature of the request
|
int |
hashCode()
Returns a hash code value for the object.
|
static byte[] |
serialize(java.lang.String contractId,
java.lang.String argument,
java.lang.String entityId,
int keyVersion) |
void |
validateAuditorSignatureWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
Validates if the signature from an auditor is not tampered
|
void |
validateWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
Validates if the request is not tampered.
|
getEntityId, getKeyVersion
public ContractExecutionRequest(java.lang.String nonce, java.lang.String entityId, int keyVersion, java.lang.String contractId, java.lang.String contractArgument, java.util.List<java.lang.String> functionIds, @Nullable java.lang.String functionArgument, byte[] signature, @Nullable byte[] auditorSignature)
ContractExecutionRequest
with the specified nonce, contract id, argument,
entity ID, key version, a list of AssetProof
and signature of the request.nonce
- the unique id of a requestentityId
- an entity IDkeyVersion
- the version of a digital signature certificate or a HMAC secret key.contractId
- a contract id of a registered contract to executecontractArgument
- an argument to a contractfunctionIds
- a list of function idsfunctionArgument
- an argument to a functionsignature
- a signature of the requestauditorSignature
- a signature from an auditorpublic java.lang.String getNonce()
public java.lang.String getContractId()
public java.lang.String getContractArgument()
public java.util.List<java.lang.String> getFunctionIds()
public java.util.Optional<java.lang.String> getFunctionArgument()
Optional
with the argument to user-defined functionspublic byte[] getSignature()
public byte[] getAuditorSignature()
public void validateWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
validateWith
in class AbstractRequest
validator
- a SignatureValidator
com.scalar.dl.ledger.exception.SignatureException
- if the request is invalid.public void validateAuditorSignatureWith(com.scalar.dl.ledger.crypto.SignatureValidator validator)
validator
- a SignatureValidator
com.scalar.dl.ledger.exception.SignatureException
- if the signature is invalid.public int hashCode()
hashCode
in class AbstractRequest
public boolean equals(java.lang.Object o)
ContractExecutionRequest
and
equals
in class AbstractRequest
o
- an object to be tested for equalitytrue
if the other object is "equal to" this object otherwise false
public static byte[] serialize(java.lang.String contractId, java.lang.String argument, java.lang.String entityId, int keyVersion)