mirror of
https://github.com/logos-co/staking.git
synced 2025-01-24 01:21:26 +00:00
test(StakeManager): expand on deployment test (#27)
Added some additional assertions related to access control and exposed properties.
This commit is contained in:
parent
abe11d6806
commit
725d380547
1
.gas-snapshot
Normal file
1
.gas-snapshot
Normal file
@ -0,0 +1 @@
|
||||
StakeManagerTest:testDeployment() (gas: 26172)
|
@ -8,7 +8,7 @@ import { StakeManager } from "../contracts/StakeManager.sol";
|
||||
contract Deploy is BaseScript {
|
||||
function run() public returns (StakeManager, DeploymentConfig) {
|
||||
DeploymentConfig deploymentConfig = new DeploymentConfig(broadcaster);
|
||||
(address token,) = deploymentConfig.activeNetworkConfig();
|
||||
(, address token) = deploymentConfig.activeNetworkConfig();
|
||||
|
||||
vm.startBroadcast(broadcaster);
|
||||
StakeManager stakeManager = new StakeManager(token, address(0));
|
||||
|
@ -29,7 +29,7 @@ contract DeploymentConfig is Script {
|
||||
}
|
||||
|
||||
function getOrCreateAnvilEthConfig(address _deployer) public returns (NetworkConfig memory) {
|
||||
vm.startBroadcast();
|
||||
vm.startBroadcast(_deployer);
|
||||
MockERC20 token = new MockERC20();
|
||||
vm.stopBroadcast();
|
||||
return NetworkConfig({ token: address(token), deployer: _deployer });
|
||||
|
@ -7,19 +7,26 @@ import { DeploymentConfig } from "../script/DeploymentConfig.s.sol";
|
||||
import { StakeManager } from "../contracts/StakeManager.sol";
|
||||
|
||||
contract StakeManagerTest is Test {
|
||||
address internal deployer;
|
||||
|
||||
DeploymentConfig internal deploymentConfig;
|
||||
StakeManager internal stakeManager;
|
||||
|
||||
address internal stakeToken;
|
||||
address internal deployer;
|
||||
|
||||
function setUp() public virtual {
|
||||
Deploy deployment = new Deploy();
|
||||
(stakeManager, deploymentConfig) = deployment.run();
|
||||
(deployer,) = deploymentConfig.activeNetworkConfig();
|
||||
(deployer, stakeToken) = deploymentConfig.activeNetworkConfig();
|
||||
}
|
||||
|
||||
function testDeployment() public {
|
||||
assertEq(stakeManager.owner(), deployer);
|
||||
assertEq(stakeManager.currentEpoch(), 0);
|
||||
assertEq(stakeManager.pendingReward(), 0);
|
||||
assertEq(stakeManager.multiplierSupply(), 0);
|
||||
assertEq(stakeManager.stakeSupply(), 0);
|
||||
assertEq(address(stakeManager.stakedToken()), stakeToken);
|
||||
assertEq(address(stakeManager.oldManager()), address(0));
|
||||
assertEq(stakeManager.totalSupply(), 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user