public abstract class AbstractOperationContext extends AbstractContractContext
AbstractContractContext.EventSource
Modifier and Type | Field and Description |
---|---|
protected long |
blockId |
protected int |
chain |
protected byte[] |
fullHash |
chainById, chainByName, config, contractName, contractSetupParameters, FEE_CANNOT_CALCULATE, FEE_EXCEEDS_AMOUNT, INTERNAL_ERROR_CODE_THRESHOLD, MESSAGE_TO_ENCRYPT_WITHOUT_SECRET_PHRASE, response, source, VALIDATE_SAME_ACCOUNT_CODE, VALIDATE_SAME_CHAIN, VALIDATE_SAME_TRANSACTION_TYPE
Constructor and Description |
---|
AbstractOperationContext(byte[] fullHash,
int chainId,
long blockId,
ContractRunnerConfig config,
JO runtimeParams,
java.lang.String contractName,
java.lang.String seed) |
Modifier and Type | Method and Description |
---|---|
long |
getAmountNQT()
Returns the child chain amount of the trigger transaction
|
ChainWrapper |
getChainOfTransaction()
Returns the chain object of the trigger transaction
|
protected JO |
getPhasingAttachment() |
long |
getRandomSeed()
Returns the random seed used by the contract to generate random numbers
|
long |
getRecipientId()
Returns the numeric id of the recipient account
|
JO |
getRuntimeParams()
Returns the parameters passed to this contract invocation
|
long |
getSenderId()
Returns the numeric id of the sender account
|
abstract TransactionResponse |
getTransaction()
Returns an object representing the trigger transaction data
|
protected abstract JO |
getTransactionJson()
Returns the Json representation of the trigger transaction data
|
boolean |
isSameChain(int chainId)
Returns true if the chain id is equal to the trigger transaction chain id
|
boolean |
isSameRecipient()
Deprecated.
|
boolean |
isSameSender()
Returns true if the trigger transaction sender is the same account as the contract runner account
in other words, returns true if the trigger transaction was sent by this contract runner
|
boolean |
notPaymentTransaction()
Returns true if the trigger transaction is not a send money transaction
|
boolean |
notSameChain(int chainId)
Returns true if the chain id is not equal to the trigger transaction chain id
|
boolean |
notSameRecipient()
Returns true if the trigger transaction recipient is not the same account as the contract runner account
in other words, returns true if the trigger transaction specified a different recipient than this contract runner account
|
boolean |
notSameSender()
Returns true if the trigger transaction sender is not the same account as the contract runner account
in other words, returns true if the trigger transaction was submitted by a different sender than this contract runner account
|
boolean |
validateSameAccount(java.lang.String attribute)
Returns true if the account id resolved from the attribute is the same account as the contract runner account
|
addTriggerData, canSetResponse, createTransaction, createTransaction, fullHashToId, fullHashToId, generateErrorResponse, generateInfoResponse, generateInternalErrorResponse, generateResponse, getAccount, getAccountRs, getBlock, getBlockchainConstants, getBlockchainHeight, getChain, getChain, getConfig, getContext, getContractName, getContractRunnerConfigParams, getContractSetupParameters, getHash, getHash, getNetworkType, getParams, getParentChain, getPublicKey, getPublicKey, getPublicKeyHexString, getRandomnessSource, getReferencedTransaction, getResponse, getSource, initRandom, isPermissionGranted, loadContract, logErrorMessage, logInfoMessage, parseAccountId, parseHexString, publicKeyToAccountId, publicKeyToAccountId, rsAccount, setContractSetupParameters, setResponse, sign, toHexString, verify
protected final byte[] fullHash
protected final int chain
protected final long blockId
public AbstractOperationContext(byte[] fullHash, int chainId, long blockId, ContractRunnerConfig config, JO runtimeParams, java.lang.String contractName, java.lang.String seed)
protected abstract JO getTransactionJson()
public abstract TransactionResponse getTransaction()
public JO getRuntimeParams()
getRuntimeParams
in class AbstractContractContext
public long getAmountNQT()
public long getSenderId()
public long getRecipientId()
public ChainWrapper getChainOfTransaction()
@Deprecated public boolean isSameRecipient()
public boolean notSameRecipient()
public boolean isSameSender()
public boolean notSameSender()
public boolean validateSameAccount(java.lang.String attribute)
attribute
- the key name whose value represents the account idpublic boolean notPaymentTransaction()
public boolean isSameChain(int chainId)
chainId
- the chain idpublic boolean notSameChain(int chainId)
chainId
- the chain idpublic long getRandomSeed()
protected JO getPhasingAttachment()
getPhasingAttachment
in class AbstractContractContext