-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shuffle elected validators using block randomness (#1033)
- Loading branch information
1 parent
a3d94cc
commit d0de17e
Showing
5 changed files
with
73 additions
and
12 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,23 @@ | ||
pragma solidity ^0.5.8; | ||
|
||
import "../interfaces/IRandom.sol"; | ||
|
||
/** | ||
* @title Returns a fixed value to test 'random' things | ||
*/ | ||
contract MockRandom is IRandom { | ||
|
||
bytes32 public _r; | ||
|
||
function revealAndCommit( | ||
bytes32 randomness, | ||
bytes32 newCommitment, | ||
address proposer | ||
) external { | ||
_r = randomness; | ||
} | ||
|
||
function random() external view returns (bytes32) { | ||
return _r; | ||
} | ||
} |
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