Helius
2022-03-25 9d35b79aea125eaf022aa619848fed3e7c0ad6bb
src/main/java/cc/mrbird/febs/dapp/chain/EthService.java
@@ -2,6 +2,7 @@
import cc.mrbird.febs.common.exception.FebsException;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.web3j.abi.FunctionEncoder;
@@ -235,14 +236,12 @@
      byte[] signedMessage = TransactionEncoder.signMessage(rawTransaction, credentials);
      String hexValue = Numeric.toHexString(signedMessage);
      // log.debug("transfer hexValue:" + hexValue);
      CompletableFuture<EthSendTransaction> ethSendTransactionCompletableFuture = web3j.ethSendRawTransaction(hexValue).sendAsync();
      EthSendTransaction ethSendTransaction = ethSendTransactionCompletableFuture.get();
      //return "hash";
//      log.info("====:{}", JSONObject.toJSONString(ethSendTransaction));
      if (ethSendTransaction.hasError()) {
         // log.info("transfer error:", ethSendTransaction.getError().getMessage());
         return "";
      } else {
         String transactionHash = ethSendTransaction.getTransactionHash();