generated from GenerationSoftware/foundry-template
-
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.
Updated RngBlockhash to use latest DrawManager
- Loading branch information
1 parent
b802a5b
commit 633ccf3
Showing
6 changed files
with
44 additions
and
60 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
Submodule pt-v5-draw-manager
updated
7 files
+1 −1 | foundry.toml | |
+229 −230 | src/DrawManager.sol | |
+1 −1 | src/interfaces/IRng.sol | |
+4 −4 | src/libraries/RewardLib.sol | |
+188 −49 | test/DrawManager.t.sol | |
+1 −1 | test/libraries/RewardLib.t.sol | |
+3 −3 | test/wrappers/RewardLibWrapper.sol |
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 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: GPL-3.0 | ||
pragma solidity ^0.8.24; | ||
|
||
import "forge-std/Test.sol"; | ||
import { DrawManager } from "pt-v5-draw-manager/DrawManager.sol"; | ||
|
||
import { RngBlockhash } from "../src/RngBlockhash.sol"; | ||
|
||
contract RngBlockhashTest is Test { | ||
|
||
RngBlockhash rng; | ||
DrawManager drawManager; | ||
|
||
function setUp() public { | ||
rng = new RngBlockhash(); | ||
drawManager = DrawManager(makeAddr("drawManager")); | ||
vm.etch(address(drawManager), "drawManager"); // to ensure calls fail if not mocked | ||
} | ||
|
||
function test_startDraw() public { | ||
address recipient = makeAddr("recipient"); | ||
vm.mockCall(address(drawManager), abi.encodeWithSelector(drawManager.startDraw.selector, recipient, 1), abi.encode(22)); | ||
assertEq(rng.startDraw(drawManager, recipient), 22); | ||
} | ||
|
||
} |