-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate tests for wega random number controller
- Loading branch information
Showing
43 changed files
with
3,443 additions
and
342 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.19; | ||
import './events/IWegaRandomizerControllerEvents.sol'; | ||
|
||
interface IWegaRandomizerController is IWegaRandomizerControllerEvents { | ||
/** | ||
* @notice this method calculates rollValue | ||
* @param denominator the posibilities that can be rolled | ||
*/ | ||
function generate(uint256 denominator) external returns(uint256); | ||
|
||
/** | ||
* @notice this method calculates rollValue | ||
* @param newRandomizer address of the new randomizer | ||
*/ | ||
function setRandomizer(address newRandomizer) external; | ||
|
||
/** | ||
* @notice seeds the randomizer with new random number values | ||
* @param randomNumbers randomnumbers to add | ||
*/ | ||
function seedRandomizer(uint256[] memory randomNumbers) external; | ||
|
||
/** | ||
* @notice increments the user nonce on the randomizer | ||
*/ | ||
function incrementControllerNonce() external; | ||
} |
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,5 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.14; | ||
interface IWegaRandomizerControllerEvents { | ||
event RandomizerSet(address indexed newRandomizer); | ||
} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.14; | ||
|
||
interface IWegaRandomizer { | ||
|
||
/** | ||
* @notice returns the current length of randomnumbers set | ||
*/ | ||
function randomNumbersCount() external view returns (uint256); | ||
|
||
/** | ||
* @notice adds random numbers from a source to the random number set | ||
* @param randomNumbers the randomnumber that should be added | ||
*/ | ||
function seed(uint256[] memory randomNumbers) external; | ||
|
||
/** | ||
* @notice retrieves a random number based on the current owner nonce | ||
*/ | ||
function retrieve() external view returns(uint256); | ||
|
||
/** | ||
* @notice increments the nonce for the game controller | ||
*/ | ||
function useOwnerNonce() external returns (uint256); | ||
} |
Oops, something went wrong.