Commit 10667c03 authored by Kelvin Fichter's avatar Kelvin Fichter

Fixed em.run

parent abc2095d
...@@ -103,10 +103,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { ...@@ -103,10 +103,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
override override
public public
{ {
// Initialize the transaction context. // Store our OVM_StateManager instance (significantly easier than attempting to pass the address
transactionContext.ovmTIMESTAMP = _transaction.timestamp; // around in calldata).
transactionContext.ovmTXGASLIMIT = _transaction.gasLimit; ovmStateManager = iOVM_StateManager(_ovmStateManager);
transactionContext.ovmQUEUEORIGIN = _transaction.queueOrigin;
// Check whether we need to start a new epoch, do so if necessary. // Check whether we need to start a new epoch, do so if necessary.
_checkNeedsNewEpoch(_transaction.timestamp); _checkNeedsNewEpoch(_transaction.timestamp);
...@@ -117,10 +116,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { ...@@ -117,10 +116,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
return; return;
} }
// Store our OVM_StateManager instance (significantly easier than attempting to pass the address // Initialize the execution context.
// around in calldata). _initContext(_transaction);
ovmStateManager = iOVM_StateManager(_ovmStateManager);
// Run the transaction, make sure to meter the gas usage. // Run the transaction, make sure to meter the gas usage.
uint256 gasLimit = gasleft(); uint256 gasLimit = gasleft();
ovmCALL( ovmCALL(
...@@ -1527,6 +1525,21 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { ...@@ -1527,6 +1525,21 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
} }
} }
/**
* Initializes the execution context.
* @param _transaction OVM transaction being executed.
*/
function _initContext(
Lib_OVMCodec.Transaction memory _transaction
)
internal
{
transactionContext.ovmTIMESTAMP = _transaction.timestamp;
transactionContext.ovmTXGASLIMIT = _transaction.gasLimit;
transactionContext.ovmQUEUEORIGIN = _transaction.queueOrigin;
transactionContext.ovmGASLIMIT = gasMeterConfig.maxGasPerQueuePerEpoch;
}
/** /**
* Resets the transaction and message context. * Resets the transaction and message context.
*/ */
......
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