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
278b093b
Commit
278b093b
authored
Jun 13, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove games accessor and add len/count accessor
parent
ede728c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
DisputeGameFactory.sol
...ontracts-bedrock/contracts/dispute/DisputeGameFactory.sol
+2
-2
IDisputeGameFactory.sol
...rock/contracts/dispute/interfaces/IDisputeGameFactory.sol
+3
-3
DisputeGameFactory.t.sol
...contracts-bedrock/contracts/test/DisputeGameFactory.t.sol
+2
-3
No files found.
packages/contracts-bedrock/contracts/dispute/DisputeGameFactory.sol
View file @
278b093b
...
...
@@ -50,8 +50,8 @@ contract DisputeGameFactory is Ownable, IDisputeGameFactory {
/**
* @inheritdoc IDisputeGameFactory
*/
function
allGames() external view returns (IDisputeGame[] memory _disputeGameLis
t) {
_
disputeGameList = disputeGameList
;
function
gameCount() external view returns (uint256 _gameCoun
t) {
_
gameCount = disputeGameList.length
;
}
/**
...
...
packages/contracts-bedrock/contracts/dispute/interfaces/IDisputeGameFactory.sol
View file @
278b093b
...
...
@@ -30,10 +30,10 @@ interface IDisputeGameFactory {
event ImplementationSet(address indexed impl, GameType indexed gameType);
/**
* @notice
retrieves a list of all
dispute games created by this factory.
* @return _
disputeGameList The list of all
dispute games created by this factory.
* @notice
the total number of
dispute games created by this factory.
* @return _
gameCount The total number of
dispute games created by this factory.
*/
function
allGames() external view returns (IDisputeGame[] memory _disputeGameLis
t);
function
gameCount() external view returns (uint256 _gameCoun
t);
/**
* @notice `games` queries an internal a mapping that maps the hash of
...
...
packages/contracts-bedrock/contracts/test/DisputeGameFactory.t.sol
View file @
278b093b
...
...
@@ -48,9 +48,8 @@ contract DisputeGameFactory_Test is Test {
// Ensure that the dispute game was assigned to the `disputeGames` mapping.
assertEq(address(factory.games(gt, rootClaim, extraData)), address(proxy));
IDisputeGame[] memory disputeGameList = factory.allGames();
assertEq(disputeGameList.length, 1);
assertEq(address(disputeGameList[0]), address(proxy));
assertEq(factory.gameCount(), 1);
assertEq(address(factory.disputeGameList(0)), address(proxy));
}
/**
...
...
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