本文整理汇总了Java中org.ethereum.vm.program.invoke.ProgramInvokeImpl类的典型用法代码示例。如果您正苦于以下问题:Java ProgramInvokeImpl类的具体用法?Java ProgramInvokeImpl怎么用?Java ProgramInvokeImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProgramInvokeImpl类属于org.ethereum.vm.program.invoke包,在下文中一共展示了ProgramInvokeImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generalInvoke
import org.ethereum.vm.program.invoke.ProgramInvokeImpl; //导入依赖的package包/类
private ProgramInvoke generalInvoke(Transaction tx, int txindex, Repository repository, BlockStore blockStore) {
/*** ADDRESS op ***/
// YP: Get address of currently executing account.
byte[] address = tx.isContractCreation() ? tx.getContractAddress().getBytes() : tx.getReceiveAddress().getBytes();
/*** ORIGIN op ***/
// YP: This is the sender of original transaction; it is never a contract.
byte[] origin = tx.getSender().getBytes();
/*** CALLER op ***/
// YP: This is the address of the account that is directly responsible for this execution.
byte[] caller = tx.getSender().getBytes();
/*** BALANCE op ***/
byte[] balance = repository.getBalance(address).toByteArray();
/*** GASPRICE op ***/
byte[] gasPrice = tx.getGasPrice();
/*** GAS op ***/
byte[] gas = tx.getGasLimit();
/*** CALLVALUE op ***/
byte[] callValue = tx.getValue() == null ? new byte[]{0} : tx.getValue();
/*** CALLDATALOAD op ***/
/*** CALLDATACOPY op ***/
/*** CALLDATASIZE op ***/
byte[] data = tx.isContractCreation() ? ByteUtil.EMPTY_BYTE_ARRAY :( tx.getData() == null ? ByteUtil.EMPTY_BYTE_ARRAY : tx.getData() );
// byte[] data = tx.getData() == null ? ByteUtil.EMPTY_BYTE_ARRAY : tx.getData() ;
/*** PREVHASH op ***/
byte[] lastHash = env.getPreviousHash();
/*** COINBASE op ***/
byte[] coinbase = env.getCurrentCoinbase();
/*** TIMESTAMP op ***/
long timestamp = ByteUtil.byteArrayToLong(env.getCurrentTimestamp());
/*** NUMBER op ***/
long number = ByteUtil.byteArrayToLong(env.getCurrentNumber());
/*** DIFFICULTY op ***/
byte[] difficulty = env.getCurrentDifficulty();
/*** GASLIMIT op ***/
byte[] gaslimit = env.getCurrentGasLimit();
return new ProgramInvokeImpl(address, origin, caller, balance,
gasPrice, gas, callValue, data, lastHash, coinbase,
timestamp, number, txindex, difficulty, gaslimit, repository, blockStore);
}
示例2: generalInvoke
import org.ethereum.vm.program.invoke.ProgramInvokeImpl; //导入依赖的package包/类
private ProgramInvoke generalInvoke(Transaction tx, Repository repository, BlockStore blockStore) {
/*** ADDRESS op ***/
// YP: Get address of currently executing account.
byte[] address = tx.isContractCreation() ? tx.getContractAddress() : tx.getReceiveAddress();
/*** ORIGIN op ***/
// YP: This is the sender of original transaction; it is never a contract.
byte[] origin = tx.getSender();
/*** CALLER op ***/
// YP: This is the address of the account that is directly responsible for this execution.
byte[] caller = tx.getSender();
/*** BALANCE op ***/
byte[] balance = repository.getBalance(address).toByteArray();
/*** GASPRICE op ***/
byte[] gasPrice = tx.getGasPrice();
/*** GAS op ***/
byte[] gas = tx.getGasLimit();
/*** CALLVALUE op ***/
byte[] callValue = tx.getValue() == null ? new byte[]{0} : tx.getValue();
/*** CALLDATALOAD op ***/
/*** CALLDATACOPY op ***/
/*** CALLDATASIZE op ***/
byte[] data = tx.isContractCreation() ? ByteUtil.EMPTY_BYTE_ARRAY :( tx.getData() == null ? ByteUtil.EMPTY_BYTE_ARRAY : tx.getData() );
// byte[] data = tx.getData() == null ? ByteUtil.EMPTY_BYTE_ARRAY : tx.getData() ;
/*** PREVHASH op ***/
byte[] lastHash = env.getPreviousHash();
/*** COINBASE op ***/
byte[] coinbase = env.getCurrentCoinbase();
/*** TIMESTAMP op ***/
long timestamp = ByteUtil.byteArrayToLong(env.getCurrentTimestamp());
/*** NUMBER op ***/
long number = ByteUtil.byteArrayToLong(env.getCurrentNumber());
/*** DIFFICULTY op ***/
byte[] difficulty = env.getCurrentDifficulty();
/*** GASLIMIT op ***/
byte[] gaslimit = env.getCurrentGasLimit();
return new ProgramInvokeImpl(address, origin, caller, balance,
gasPrice, gas, callValue, data, lastHash, coinbase,
timestamp, number, difficulty, gaslimit, repository, blockStore);
}