-
Notifications
You must be signed in to change notification settings - Fork 0
use default bribe platform from config, paladin integration adjustments #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
add2df7
use default bribe platform from config, paladin integration adjusments
jalbrekt85 4886ceb
add comments for createRangedQuest params
jalbrekt85 821170d
revert config urls back to main
jalbrekt85 68b7e58
add back gauge check functions
jalbrekt85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| from .base import BribePlatform | ||
| from .factory import BribePlatformFactory | ||
| from .factory import get_platform | ||
| from .hiddenhand import HiddenHandPlatform | ||
| from .paladin import PaladinPlatform | ||
| from .stakedao import StakeDAOPlatform | ||
|
|
||
| __all__ = [ | ||
| "BribePlatform", | ||
| "BribePlatformFactory", | ||
| "get_platform", | ||
| "HiddenHandPlatform", | ||
| "PaladinPlatform", | ||
| "StakeDAOPlatform", | ||
| ] | ||
| ] |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,68 +1,26 @@ | ||
| from typing import Dict, Any, List | ||
| from typing import Dict, Any | ||
| from .base import BribePlatform | ||
| from .hiddenhand import HiddenHandPlatform | ||
| from .paladin import PaladinPlatform | ||
| from .stakedao import StakeDAOPlatform | ||
|
|
||
|
|
||
| class BribePlatformFactory: | ||
| """Factory for creating bribe platform instances based on configuration""" | ||
|
|
||
| _platforms = { | ||
| "hh": HiddenHandPlatform, | ||
| "paladin": PaladinPlatform, | ||
| "stakedao": StakeDAOPlatform, | ||
| } | ||
|
|
||
| @classmethod | ||
| def register_platform(cls, config_key: str, platform_class: type): | ||
| """ | ||
| Register a new platform class | ||
|
|
||
| Args: | ||
| config_key: The configuration key (e.g., 'hh', 'paladin', 'stakedao') | ||
| platform_class: The platform class that implements BribePlatform | ||
| """ | ||
| cls._platforms[config_key] = platform_class | ||
|
|
||
| @classmethod | ||
| def get_platform(cls, platform_name: str, book: Dict[str, str], run_config: Any) -> BribePlatform: | ||
| """ | ||
| Get platform instance based on platform name | ||
|
|
||
| Args: | ||
| platform_name: Platform name ('hh', 'paladin', 'stakedao') | ||
| book: Address book dictionary | ||
| run_config: Run configuration object | ||
|
|
||
| Returns: | ||
| BribePlatform instance | ||
|
|
||
| Raises: | ||
| ValueError: If platform_name is not recognized | ||
| """ | ||
| if not platform_name or platform_name == "hh": | ||
| return HiddenHandPlatform(book, run_config) | ||
|
|
||
| platform_class = cls._platforms.get(platform_name) | ||
| if not platform_class: | ||
| raise ValueError(f"Unknown platform: {platform_name}. Available: {list(cls._platforms.keys())}") | ||
|
|
||
| return platform_class(book, run_config) | ||
|
|
||
| @classmethod | ||
| def get_supported_markets(cls, platform_name: str, book: Dict[str, str], run_config: Any) -> List[str]: | ||
| """ | ||
| Get list of supported markets for a platform | ||
|
|
||
| Args: | ||
| platform_name: Platform name | ||
| book: Address book dictionary | ||
| run_config: Run configuration object | ||
|
|
||
| Returns: | ||
| List of supported market names | ||
| """ | ||
| platform = cls.get_platform(platform_name, book, run_config) | ||
| return platform.supported_markets | ||
|
|
||
| def get_platform(platform_name: str, book: Dict[str, str], run_config: Any) -> BribePlatform: | ||
| """ | ||
| Get platform instance based on platform name. | ||
|
|
||
| Args: | ||
| platform_name: 'stakedao', 'paladin', or 'hh' | ||
| book: Address book dictionary | ||
| run_config: Run configuration object | ||
|
|
||
| Returns: | ||
| BribePlatform instance | ||
| """ | ||
| if platform_name == "stakedao": | ||
| return StakeDAOPlatform(book, run_config) | ||
| elif platform_name == "paladin": | ||
| return PaladinPlatform(book, run_config) | ||
| elif platform_name == "hh": | ||
| return HiddenHandPlatform(book, run_config) | ||
| raise ValueError(f"Unknown platform: {platform_name}") |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.