Skip to content

Commit

Permalink
feat(ApiWrapper):fix getTransactionFromPending bug
Browse files Browse the repository at this point in the history
  • Loading branch information
endiaoekoe committed May 17, 2023
1 parent 7dccfc7 commit 2a45ffe
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.tron.trident.core.key.KeyPair;
import org.tron.trident.core.transaction.BlockId;
import org.tron.trident.core.transaction.TransactionBuilder;
import org.tron.trident.core.utils.ByteArray;
import org.tron.trident.core.utils.Sha256Hash;
import org.tron.trident.core.transaction.TransactionCapsule;
import org.tron.trident.core.utils.Utils;
Expand Down Expand Up @@ -1914,15 +1915,12 @@ public long getPendingSize() {
* @throws IllegalException if fail to get transaction from pending
*/
public Transaction getTransactionFromPending(String txId) throws IllegalException {
ByteString bsTxid = parseAddress(txId);
ByteString bsTxid = ByteString.copyFrom(ByteArray.fromHexString(txId));
BytesMessage request = BytesMessage.newBuilder()
.setValue(bsTxid)
.build();

Transaction transaction = blockingStubSolidity.getTransactionById(request);
if(transaction.getRetCount() == 0){
throw new IllegalException();
}
Transaction transaction = blockingStub.getTransactionFromPending(request);
return transaction;
}

Expand Down

0 comments on commit 2a45ffe

Please sign in to comment.