-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #744 from NexusMutual/chore/get-covers
Reimplement getCovers in CoverViewer
- Loading branch information
Showing
17 changed files
with
157 additions
and
247 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
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,40 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
pragma solidity ^0.8.9; | ||
|
||
import "../../interfaces/ICover.sol"; | ||
|
||
contract CVMockCover { | ||
|
||
mapping(uint => CoverSegment[]) public _coverSegments; | ||
mapping(uint => CoverData) public _coverData; | ||
|
||
function addCoverData(uint coverId, CoverData memory coverData) public { | ||
_coverData[coverId] = coverData; | ||
} | ||
|
||
function addSegments(uint coverId, CoverSegment[] memory segments) public { | ||
for (uint i = 0; i < segments.length; i++) { | ||
_coverSegments[coverId].push(segments[i]); | ||
} | ||
} | ||
|
||
function coverData(uint coverId) external view returns (CoverData memory) { | ||
return _coverData[coverId]; | ||
} | ||
|
||
function coverSegmentsCount(uint coverId) external view returns (uint) { | ||
return _coverSegments[coverId].length; | ||
} | ||
|
||
function coverSegments(uint coverId) external view returns (CoverSegment[] memory) { | ||
return _coverSegments[coverId]; | ||
} | ||
|
||
function coverSegmentWithRemainingAmount( | ||
uint coverId, | ||
uint segmentId | ||
) external view returns (CoverSegment memory) { | ||
return _coverSegments[coverId][segmentId]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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.