Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/com/baidu/xuper/api/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public Transaction(String chainName, XchainOuterClass.Transaction tx) {

Transaction(XchainOuterClass.InvokeRPCResponse rpcResponse, Proposal proposal) {
this.proposal = proposal;
this.gasUsed = rpcResponse.getResponse().getGasUsed();
if (rpcResponse.getResponse().getResponseCount() != 0) {
this.contractResponse = new ContractResponse(rpcResponse.getResponse().getResponses(rpcResponse.getResponse().getResponseCount() - 1));
if (this.contractResponse.getStatus() >= 400) {
Expand All @@ -48,6 +49,8 @@ public Transaction(String chainName, XchainOuterClass.Transaction tx) {

Transaction(XchainOuterClass.PreExecWithSelectUTXOResponse response, Proposal proposal, XuperClient client) throws Exception {
XchainOuterClass.InvokeResponse invokeResponse = response.getResponse();
this.proposal = proposal;
this.gasUsed = invokeResponse.getGasUsed();
if (invokeResponse.getResponseCount() != 0) {
this.contractResponse = new ContractResponse(invokeResponse.getResponses(invokeResponse.getResponseCount() - 1));
if (this.contractResponse.getStatus() >= 400) {
Expand All @@ -56,9 +59,6 @@ public Transaction(String chainName, XchainOuterClass.Transaction tx) {
+ " message:" + this.contractResponse.getMessage());
}
}
this.proposal = proposal;
this.gasUsed = invokeResponse.getGasUsed();

try {
if (!Config.hasConfigFile() || !Config.getInstance().getComplianceCheck().getIsNeedComplianceCheck()) {
genRealTxOnly(response, proposal);
Expand Down