-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from skalenetwork/enhancement/SKALE-4300-add-…
…all-roles SKALE-4300 Add all roles, update tests provision, update SM version
- Loading branch information
Showing
11 changed files
with
175 additions
and
26 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,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of SKALE.py | ||
# | ||
# Copyright (C) 2021 SKALE Labs | ||
# | ||
# SKALE.py is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# SKALE.py is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with SKALE.py. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
from skale.contracts.base_contract import BaseContract, transaction_method | ||
from skale.transactions.result import TxRes | ||
|
||
|
||
class BountyV2(BaseContract): | ||
@transaction_method | ||
def grant_role(self, role: bytes, owner: str) -> TxRes: | ||
return self.contract.functions.grantRole(role, owner) | ||
|
||
def has_role(self, role: bytes, address: str) -> bool: | ||
return self.contract.functions.hasRole(role, address).call() | ||
|
||
def bounty_reduction_manager_role(self): | ||
return self.contract.functions.BOUNTY_REDUCTION_MANAGER_ROLE().call() |
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,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of SKALE.py | ||
# | ||
# Copyright (C) 2021 SKALE Labs | ||
# | ||
# SKALE.py is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# SKALE.py is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with SKALE.py. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
from skale.contracts.base_contract import BaseContract, transaction_method | ||
from skale.transactions.result import TxRes | ||
|
||
|
||
class Punisher(BaseContract): | ||
@transaction_method | ||
def grant_role(self, role: bytes, owner: str) -> TxRes: | ||
return self.contract.functions.grantRole(role, owner) | ||
|
||
def has_role(self, role: bytes, address: str) -> bool: | ||
return self.contract.functions.hasRole(role, address).call() | ||
|
||
def forgiver_role(self): | ||
return self.contract.functions.FORGIVER_ROLE().call() |
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