-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): add DrawCalculatorV3 unit tests
- Loading branch information
1 parent
8e70edb
commit 4615b03
Showing
5 changed files
with
1,557 additions
and
32 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,46 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.8.6; | ||
|
||
import "../DrawCalculatorV3.sol"; | ||
|
||
contract DrawCalculatorV3Harness is DrawCalculatorV3 { | ||
constructor( | ||
IGaugeController _gaugeController, | ||
IDrawBuffer _drawBuffer, | ||
IPrizeConfigHistory _prizeConfigHistory, | ||
address _owner | ||
) DrawCalculatorV3(_gaugeController, _drawBuffer, _prizeConfigHistory, _owner) {} | ||
|
||
function calculateTierIndex( | ||
uint256 _randomNumberThisPick, | ||
uint256 _winningRandomNumber, | ||
uint256[] memory _masks | ||
) public pure returns (uint256) { | ||
return _calculateTierIndex(_randomNumberThisPick, _winningRandomNumber, _masks); | ||
} | ||
|
||
function createBitMasks(uint8 _matchCardinality, uint8 _bitRangeSize) | ||
public | ||
pure | ||
returns (uint256[] memory) | ||
{ | ||
return _createBitMasks(_matchCardinality, _bitRangeSize); | ||
} | ||
|
||
function calculatePrizeTierFraction( | ||
uint256 _prizeFraction, | ||
uint8 _bitRangeSize, | ||
uint256 _prizeConfigIndex | ||
) external pure returns (uint256) { | ||
return _calculatePrizeTierFraction(_prizeFraction, _bitRangeSize, _prizeConfigIndex); | ||
} | ||
|
||
function numberOfPrizesForIndex(uint8 _bitRangeSize, uint256 _prizeConfigIndex) | ||
external | ||
pure | ||
returns (uint256) | ||
{ | ||
return _numberOfPrizesForIndex(_bitRangeSize, _prizeConfigIndex); | ||
} | ||
} |
Oops, something went wrong.