Commit d6b85865 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

ctc: less calls (#205)

parent 936d9986
...@@ -177,9 +177,11 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad ...@@ -177,9 +177,11 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
Lib_OVMCodec.QueueElement memory _element Lib_OVMCodec.QueueElement memory _element
) )
{ {
iOVM_ChainStorageContainer queue = queue();
uint40 trueIndex = uint40(_index * 2); uint40 trueIndex = uint40(_index * 2);
bytes32 queueRoot = queue().get(trueIndex); bytes32 queueRoot = queue.get(trueIndex);
bytes32 timestampAndBlockNumber = queue().get(trueIndex + 1); bytes32 timestampAndBlockNumber = queue.get(trueIndex + 1);
uint40 elementTimestamp; uint40 elementTimestamp;
uint40 elementBlockNumber; uint40 elementBlockNumber;
...@@ -293,12 +295,14 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad ...@@ -293,12 +295,14 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number())) timestampAndBlockNumber := or(timestampAndBlockNumber, shl(40, number()))
} }
queue().push2( iOVM_ChainStorageContainer queue = queue();
queue.push2(
transactionHash, transactionHash,
timestampAndBlockNumber timestampAndBlockNumber
); );
uint256 queueIndex = queue().length() / 2; uint256 queueIndex = queue.length() / 2;
emit TransactionEnqueued( emit TransactionEnqueued(
msg.sender, msg.sender,
_target, _target,
...@@ -886,7 +890,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad ...@@ -886,7 +890,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
_nextContext.blockNumber <= nextQueueElement.blockNumber, _nextContext.blockNumber <= nextQueueElement.blockNumber,
"Sequencer transaction blockNumber exceeds that of next queue element." "Sequencer transaction blockNumber exceeds that of next queue element."
); );
} }
} }
/** /**
......
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