Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
753b3098
Commit
753b3098
authored
Oct 23, 2020
by
Karl Floersch
Committed by
GitHub
Oct 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make getNextQueueIndex public (#32)
parent
134b5d77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
OVM_CanonicalTransactionChain.sol
...stic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
+17
-17
iOVM_CanonicalTransactionChain.sol
...ic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol
+11
-0
No files found.
packages/contracts/contracts/optimistic-ethereum/OVM/chain/OVM_CanonicalTransactionChain.sol
View file @
753b3098
...
...
@@ -110,6 +110,21 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
return uint256(batches.getLength());
}
/**
* @inheritdoc iOVM_CanonicalTransactionChain
*/
function getNextQueueIndex()
override
public
view
returns (
uint40
)
{
(, uint40 nextQueueIndex) = _getBatchExtraData();
return nextQueueIndex;
}
/**
* @inheritdoc iOVM_CanonicalTransactionChain
*/
...
...
@@ -227,7 +242,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
"Must append more than zero transactions."
);
uint40 nextQueueIndex =
_
getNextQueueIndex();
uint40 nextQueueIndex = getNextQueueIndex();
bytes32[] memory leaves = new bytes32[](_numQueuedTransactions);
for (uint256 i = 0; i < _numQueuedTransactions; i++) {
leaves[i] = _getQueueLeafHash(nextQueueIndex);
...
...
@@ -297,7 +312,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
bytes32[] memory leaves = new bytes32[](totalElementsToAppend);
uint32 transactionIndex = 0;
uint32 numSequencerTransactionsProcessed = 0;
uint40 nextQueueIndex =
_
getNextQueueIndex();
uint40 nextQueueIndex = getNextQueueIndex();
for (uint32 i = 0; i < numContexts; i++) {
BatchContext memory context = _getBatchContext(i);
...
...
@@ -418,21 +433,6 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
});
}
/**
* Returns the index of the next element to be enqueued.
* @return Index for the next queue element.
*/
function _getNextQueueIndex()
internal
view
returns (
uint40
)
{
(, uint40 nextQueueIndex) = _getBatchExtraData();
return nextQueueIndex;
}
/**
* Parses the batch context from the extra data.
* @return Total number of elements submitted.
...
...
packages/contracts/contracts/optimistic-ethereum/iOVM/chain/iOVM_CanonicalTransactionChain.sol
View file @
753b3098
...
...
@@ -74,6 +74,17 @@ interface iOVM_CanonicalTransactionChain {
uint256 _totalBatches
);
/**
* Returns the index of the next element to be enqueued.
* @return Index for the next queue element.
*/
function getNextQueueIndex()
external
view
returns (
uint40
);
/**
* Gets the queue element at a particular index.
* @param _index Index of the queue element to access.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment