Skip to content

Commit

Permalink
update docs + remove unessesry check
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBorisov committed Jul 18, 2024
1 parent 05974ff commit d4e05c7
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ struct WithdrawalInfo {
}

interface IPenalizeableStaking is IStaking {
error ValidatorNotBanned(address staker);
error NoFundsToWithdraw();
error StakeLeftLow();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ contract PenalizeableStaking is IPenalizeableStaking, HydraChainConnector, Staki
* @inheritdoc IPenalizeableStaking
*/
function withdrawBannedFunds() external {
if (!hydraChainContract.isValidatorBanned(msg.sender)) {
revert ValidatorNotBanned(msg.sender);
}

uint256 leftToWithdraw = leftToWithdrawPerStaker[msg.sender];
if (leftToWithdraw == 0) {
revert NoFundsToWithdraw();
Expand Down
16 changes: 0 additions & 16 deletions docs/HydraStaking/HydraStaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -1340,20 +1340,4 @@ error Unauthorized(string only)
|---|---|---|
| only | string | undefined |

### ValidatorNotBanned

```solidity
error ValidatorNotBanned(address staker)
```





#### Parameters

| Name | Type | Description |
|---|---|---|
| staker | address | undefined |


16 changes: 0 additions & 16 deletions docs/HydraStaking/IHydraStaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,20 +512,4 @@ error StakeRequirement(string src, string msg)
| src | string | undefined |
| msg | string | undefined |

### ValidatorNotBanned

```solidity
error ValidatorNotBanned(address staker)
```





#### Parameters

| Name | Type | Description |
|---|---|---|
| staker | address | undefined |


Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,4 @@ error StakeRequirement(string src, string msg)
| src | string | undefined |
| msg | string | undefined |

### ValidatorNotBanned

```solidity
error ValidatorNotBanned(address staker)
```





#### Parameters

| Name | Type | Description |
|---|---|---|
| staker | address | undefined |


Original file line number Diff line number Diff line change
Expand Up @@ -902,20 +902,4 @@ error Unauthorized(string only)
|---|---|---|
| only | string | undefined |

### ValidatorNotBanned

```solidity
error ValidatorNotBanned(address staker)
```





#### Parameters

| Name | Type | Description |
|---|---|---|
| staker | address | undefined |


8 changes: 0 additions & 8 deletions test/HydraChain/Inspector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,6 @@ export function RunInspectorTests(): void {
});

describe("Withdraw banned funds", function () {
it("should revert when trying to withdraw from non banned validator", async function () {
const { hydraStaking } = await loadFixture(this.fixtures.bannedValidatorFixture);

await expect(hydraStaking.connect(this.signers.validators[2]).withdrawBannedFunds())
.to.be.revertedWithCustomError(hydraStaking, "ValidatorNotBanned")
.withArgs(this.signers.validators[2].address);
});

it("should fail the withdrawal when there are no funds in the hydraStaking", async function () {
const { bannedValidator, hydraStaking } = await loadFixture(this.fixtures.bannedValidatorFixture);

Expand Down

0 comments on commit d4e05c7

Please sign in to comment.