-
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.
- Loading branch information
Showing
13 changed files
with
165 additions
and
13 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,22 @@ | ||
<?php | ||
|
||
namespace ProvablyFair\Contracts; | ||
|
||
use ProvablyFair\Result; | ||
|
||
/** | ||
* @property SeedInterface $clientSeed | ||
* @property SeedInterface $serverSeed | ||
* @property AlgorithmInterface $algorithm | ||
*/ | ||
interface ProvablyFairInterface | ||
{ | ||
public function setSystem(SystemInterface $system): self; | ||
|
||
public function getSystem(): SystemInterface; | ||
|
||
/** | ||
* @return Result[] | ||
*/ | ||
public function generate(int $amount, bool $include_original = false): array; | ||
} |
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 |
---|---|---|
|
@@ -7,5 +7,4 @@ | |
*/ | ||
interface SeedInterface | ||
{ | ||
public function __construct(string $value); | ||
} |
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
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,29 @@ | ||
<?php | ||
|
||
namespace ProvablyFairTests; | ||
|
||
use Exception; | ||
use PHPUnit\Framework\TestCase; | ||
use ProvablyFair\Contracts\ProvablyFairInterface; | ||
use ProvablyFair\Result; | ||
|
||
final class ResultTest extends TestCase | ||
{ | ||
/** | ||
* @throws Exception | ||
*/ | ||
public function test_readonly_properties(): void | ||
{ | ||
$result = new Result( | ||
$provablyFair = $this->createMock(ProvablyFairInterface::class), | ||
$index = random_int(0, 10), | ||
$hash = uniqid(), | ||
$value = uniqid(), | ||
); | ||
|
||
$this->assertEquals($result->provablyFair, $provablyFair); | ||
$this->assertEquals($result->index, $index); | ||
$this->assertEquals($result->hash, $hash); | ||
$this->assertEquals($result->value, $value); | ||
} | ||
} |
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
ebcfb1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
provably-fair – ./
provably-fair.vercel.app
provably-fair-git-master-rogervila.vercel.app
provably-fair-rogervila.vercel.app