-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
247 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
pragma solidity 0.8.18; | ||
pragma abicoder v2; | ||
|
||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
import "./LinkedListStorage.sol"; | ||
|
||
/// @notice A linked list storage helper to test internal functions | ||
contract LinkedListStorageHelper is LinkedListStorage { | ||
|
||
// Construct | ||
constructor(RocketStorageInterface _rocketStorageAddress) LinkedListStorage(_rocketStorageAddress) { | ||
version = 1; | ||
} | ||
|
||
/// @notice Add an item to the end of the list. Requires that the item does not exist in the list | ||
/// @param _namespace defines the queue to be used | ||
/// @param _item the deposit queue item | ||
function enqueueItem(bytes32 _namespace, DepositQueueValue memory _item) public override { | ||
_enqueueItem(_namespace, _item); | ||
} | ||
|
||
/// @notice Remove an item from the start of a queue and return it. Requires that the queue is not empty | ||
/// @param _namespace defines the queue to be used | ||
function dequeueItem(bytes32 _namespace) public virtual override returns (DepositQueueValue memory item) { | ||
return _dequeueItem(_namespace); | ||
} | ||
|
||
/// @notice Removes an item from a queue. Requires that the item exists in the queue | ||
/// @param _namespace to be used | ||
/// @param _item to be removed from the queue | ||
function removeItem(bytes32 _namespace, DepositQueueValue memory _item) public virtual override { | ||
return _removeItem(_namespace, _item); | ||
} | ||
|
||
function packItem(DepositQueueValue memory _item) public pure returns (uint256 packed) { | ||
return _packItem(_item); | ||
} | ||
|
||
function unpackItem(uint256 _item) public pure returns (DepositQueueValue memory item) { | ||
return _unpackItem(_item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.