知乎专栏 | 多维度架构 |
DefaultBlockParameterName.LATEST 当前块地址 DefaultBlockParameterName.PENDING 处理中块地址
获取默认GAS Transaction.DEFAULT_GAS
]package cn.netkiller.wallet.ethereum; import org.web3j.protocol.core.methods.request.Transaction; public class Test { public Test() { // TODO Auto-generated constructor stub } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(Transaction.DEFAULT_GAS); } }
已经废弃
BigInteger gasLimit = Contract.GAS_LIMIT; BigInteger gasPrice = Contract.GAS_PRICE;
推荐使用
BigInteger gasPrice = BigInteger.ZERO; BigInteger gasLimit = BigInteger.ZERO; gasPrice = DefaultGasProvider.GAS_PRICE; gasLimit = DefaultGasProvider.GAS_LIMIT; System.out.println("gasPrice: " + gasPrice.toString()); System.out.println("gasLimit: " + gasLimit.toString());