com.jd.blockchain.ledger.TransactionResponse Maven / Gradle / Ivy
package com.jd.blockchain.ledger;
import com.jd.binaryproto.DataContract;
import com.jd.binaryproto.DataField;
import com.jd.binaryproto.PrimitiveType;
import com.jd.blockchain.consts.DataCodes;
import com.jd.blockchain.crypto.HashDigest;
/**
* 交易请求 {@link TransactionRequest} 的回复;
*
* @author huanghaiquan
*
*/
@DataContract(code = DataCodes.TX_RESPONSE)
public interface TransactionResponse {
/**
* 交易原始内容的哈希;
*
* @return
*/
@DataField(order = 1, primitiveType = PrimitiveType.BYTES)
HashDigest getContentHash();
/**
* 执行状态;
*
* @return
*/
@DataField(order = 2, refEnum = true)
TransactionState getExecutionState();
/**
* 交易被纳入的区块哈希;
*
* @return
*/
@DataField(order = 3, primitiveType = PrimitiveType.BYTES)
HashDigest getBlockHash();
/**
* 交易被纳入的区块高度;
*
*
* 如果未生成区块,则返回 -1;
*
* @return
*/
@DataField(order = 4, primitiveType = PrimitiveType.INT64)
long getBlockHeight();
/**
* 交易是否执行成功
*
* @return
*/
@DataField(order = 5, primitiveType = PrimitiveType.BOOLEAN)
boolean isSuccess();
/**
* 合约返回值
*
* @return
*/
@DataField(order=6, list=true, refContract = true)
OperationResult[] getOperationResults();
/**
* 区块结块时间
*
* @return
*/
@DataField(order = 7, primitiveType = PrimitiveType.INT64)
long getBlockGenerateTime();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy