Skip to content

Feature: Voucher Integrations #218

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Feature: Voucher Integrations #218

wants to merge 5 commits into from

Conversation

1yam
Copy link
Member

@1yam 1yam commented May 20, 2025

This PR goal is to add Voucher into the sdk

Related ClickUp, GitHub or Jira tickets : ALEPH-XXX

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • All new code is covered by relevant tests.

Changes

This pull request introduces significant enhancements to the Aleph SDK, primarily focusing on voucher management, including support for EVM and Solana vouchers, as well as improvements to address resolution and metadata handling. Additionally, it includes updates to typing and configuration settings to support these new features.

Voucher Management Enhancements:

  • Added methods in AuthenticatedAlephClient and AlephHttpClient to retrieve vouchers (get_vouchers, get_evm_vouchers, get_solana_vouchers) for EVM and Solana chains, along with helper methods for fetching voucher updates and metadata. [1] [2]
  • Introduced new models in src/aleph/sdk/types.py for Voucher, VoucherMetadata, and VoucherAttribute to represent voucher-related data.

Address Resolution:

  • Added _resolve_address methods to handle address resolution with fallback to the account's address if none is provided. [1] [2]

Configuration Updates:

  • Added new voucher-related configuration settings (VOUCHER_METDATA_TEMPLATE_URL, VOUCHER_SOL_REGISTRY, VOUCHER_SENDER) in src/aleph/sdk/conf.py to support voucher metadata and Solana registry integration.

Typing Improvements:

  • Updated imports to include overload and override for enhanced type checking and method overriding. [1] [2]
  • Extended typing in src/aleph/sdk/types.py to include Union and Decimal for voucher attributes.

These changes collectively enhance the SDK's functionality for interacting with blockchain-based vouchers while improving type safety and configurability.

@github-actions github-actions bot added the BLACK This PR has critical implications and must be reviewed by a senior engineer. label May 20, 2025
Copy link

"summary": "The provided PR includes extensive changes that modify multiple files and introduce several new features and modifications to existing logic. These changes include updating dependencies, adding new methods with complex logic, and refactoring existing code. The changes have a high potential for introducing bugs due to the extensive nature of the modifications and the complexity of the new features. Therefore, this PR requires a thorough review by experienced developers who have a deep understanding of the project architecture and its components.",
"highlight": [
{
"file": "src/aleph/sdk/client/authenticated_http.py",
"changes": [
{
"line": 679,
"description": "Adding new methods with complex logic and refactoring existing code."
},
{
"line": 685,
"description": "Adding new methods with complex logic."
},
{
"line": 691,
"description": "Adding new methods with complex logic."
},
{
"line": 697,
"description": "Adding new methods with complex logic."
}
]
},
{
"file": "src/aleph/sdk/client/http.py",
"changes": [
{
"line": 563,
"description": "Adding new methods with complex logic and refactoring existing code."
},
{
"line": 569,
"description": "Adding new methods with complex logic."
},
{
"line": 575,
"description": "Adding new methods with complex logic."
},
{
"line": 581,
"description": "Adding new methods with complex logic."
},
{
"line": 587,
"description": "Adding new methods with complex logic."
},
{
"line": 593,
"description": "Adding new methods with complex logic."
},
{
"line": 599,
"description": "Adding new methods with complex logic."
},
{
"line": 605,
"description": "Adding new methods with complex logic."
}
]
},
{
"file": "src/aleph/sdk/conf.py",
"changes": [
{
"line": 230,
"description": "Adding new configuration settings."
}
]
},
{
"file": "src/aleph/sdk/types.py",
"changes": [
{
"line": 3,
"description": "Importing new types and adding new classes."
},
{
"line": 100,
"description": "Adding new classes and modifying existing classes."
}
]
},
{
"file": "tests/unit/test_voucher.py",
"changes": [
{
"line": 1,
"description": "Adding new test module for testing complex changes."
},
{
"line": 588,
"description": "Adding new test cases for complex methods."
},
{
"line": 594,
"description": "Adding new test cases for complex methods."
},
{
"line": 600,
"description": "Adding new test cases for complex methods."
},
{
"line": 606,
"description": "Adding new test cases for complex methods."
},
{
"line": 612,
"description": "Adding new test cases for complex methods."
},
{
"line": 618,
"description": "Adding new test cases for complex methods."
},
{
"line": 624,
"description": "Adding new test cases for complex methods."
}
]
}
]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLACK This PR has critical implications and must be reviewed by a senior engineer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant