Commit c1057f76 authored by jianhua.zhang's avatar jianhua.zhang

合约验证接口调整

parent 7c2ae58c
......@@ -19,6 +19,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.tron.common.utils.ByteArray;
import org.tron.walletserver.WalletApi;
import javax.validation.Valid;
import java.util.List;
......@@ -101,7 +103,8 @@ public class ContractController {
String code = this.contractCompilerService.compiler(reqParam.getName(), reqParam.getValue(), reqParam.getCompiler());
// 根据合约地址获取合约内容
Contract con = this.tronService.getContract(reqParam.getAddress());
String hexString = ByteArray.toHexString(WalletApi.decodeFromBase58Check(reqParam.getAddress()));
Contract con = this.tronService.getContract(hexString);
// 验证合约code,如果一致,持久化到数据库中
if (con != null && !StringUtils.isEmpty(con.getBytecode())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment