Home | 简体中文 | 繁体中文 | 杂文 | 知乎专栏 | Github | OSChina 博客 | 云社区 | 云栖社区 | Facebook | Linkedin | 视频教程 | 打赏(Donations) | About
知乎专栏多维度架构微信号 netkiller-ebook | QQ群:128659835 请注明“读者”

17.5. 常量

		
DefaultBlockParameterName.LATEST	当前块地址
DefaultBlockParameterName.PENDING	处理中块地址		
		
		

17.5.1. 默认 Gas

获取默认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);

	}

}
			
			
			

17.5.2. 默认 gaslimit gasprice

已经废弃

			
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());