@ -11,14 +11,16 @@
* specific language governing permissions and limitations under the License .
*
* SPDX - License - Identifier : Apache - 2 . 0
*
* /
package org.hyperledger.besu.ethereum.vm ;
package org.hyperledger.besu.ethereum.referencetests ;
import org.hyperledger.besu.ethereum.core.Account ;
import org.hyperledger.besu.ethereum.core.Address ;
import org.hyperledger.besu.ethereum.core.BlockHeader ;
import org.hyperledger.besu.ethereum.core.Gas ;
import org.hyperledger.besu.ethereum.core.Wei ;
import org.hyperledger.besu.ethereum.vm.Code ;
import com.fasterxml.jackson.annotation.JsonCreator ;
import com.fasterxml.jackson.annotation.JsonProperty ;
@ -61,21 +63,25 @@ public class EnvironmentInformation {
/ * *
* Public constructor .
*
* @param code The code to be executed .
* @param account The address of the currently executing account .
* @param balance Balance of the account being executed
* @param caller The caller address .
* @param origin The sender address of the original transaction .
* @param code The code to be executed .
* @param data The data of the current environment that pertains to the input data passed with the
* message call instruction or transaction .
* @param value The deposited value by the instruction / transaction responsible for this execution .
* @param gas The amount of gas allocated to the transaction
* @param gasPrice The gas price specified by the originating transaction .
* @param origin The sender address of the original transaction . message call instruction or
* transaction .
* @param value The deposited value by the instruction / transaction responsible for this execution .
* @param version the account version of the account
* /
@SuppressWarnings ( "unused" ) // jackson reflected constructor
@JsonCreator
public EnvironmentInformation (
@JsonProperty ( "address" ) final String account ,
@JsonProperty ( "balance" ) final String balance ,
@JsonProperty ( "caller" ) final String caller ,
@JsonProperty ( "code" ) final CodeMock code ,
@JsonProperty ( "code" ) final ReferenceTest Code code ,
@JsonProperty ( "data" ) final String data ,
@JsonProperty ( "gas" ) final String gas ,
@JsonProperty ( "gasPrice" ) final String gasPrice ,
@ -130,61 +136,110 @@ public class EnvironmentInformation {
this . blockHeader = blockHeader ;
}
/** @return The block header. */
/ * *
* Returns the block header .
*
* @return the block header
* /
public BlockHeader getBlockHeader ( ) {
return blockHeader ;
}
/** @return The address of the currently executing account. */
/ * *
* Returns the address of the currently executing account .
*
* @return the address of the currently executing account .
* /
public Address getAccountAddress ( ) {
return accountAddress ;
}
/** @return The balance of the currently executing account */
/ * *
* Returns the balance of the currently executing account
*
* @return the balance of the currently executing account
* /
public Wei getAccountBalance ( ) {
return accountBalance ;
}
/** @return Address of the caller. */
/ * *
* Returns address of the caller .
*
* @return address of the caller .
* /
public Address getCallerAddress ( ) {
return callerAddress ;
}
/** @return The call value. */
/ * *
* Returns the call value .
*
* @return the call value .
* /
public Wei getValue ( ) {
return value ;
}
/** @return Code to be executed. */
/ * *
* Returns code to be executed .
*
* @return code to be executed .
* /
public Code getCode ( ) {
return code ;
}
/** @return The input data to be used. */
/ * *
* Returns the input data to be used .
*
* @return the input data to be used .
* /
public Bytes getData ( ) {
return data ;
}
/** @return The call depth of the current message-call/contract creation. */
/ * *
* Returns the call depth of the current message - call / contract creation .
*
* @return the call depth of the current message - call / contract creation .
* /
public int getDepth ( ) {
return depth ;
}
/** @return The gas price specified by the originating transaction. */
/ * *
* Returns the gas price specified by the originating transaction .
*
* @return the gas price specified by the originating transaction .
* /
public Wei getGasPrice ( ) {
return gasPrice ;
}
/** @return The amount of gas available. */
/ * *
* Returns the amount of gas available .
*
* @return the amount of gas available .
* /
public Gas getGas ( ) {
return gas ;
}
/** @return The sender address of the original transaction. */
/ * *
* Returns the sender address of the original transaction .
*
* @return the sender address of the original transaction .
* /
public Address getOriginAddress ( ) {
return originAddress ;
}
/ * *
* Returns the account version .
*
* @return the account version .
* /
public int getVersion ( ) {
return version ;
}