Refactor: replace VoucherManager by voucher service from sdk #390
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.
This PR remove voucher logic from CLI to go to SDK.
And replace call from the voucher manager to client.voucher...
Related ClickUp, GitHub or Jira tickets : ALEPH-542
Self proofreading checklist
Changes
This pull request refactors how voucher-related functionality is accessed in the codebase. The main change is the removal of the local
VoucherManager
implementation and the switch to using voucher methods provided by the upstreamaleph-sdk-python
package. This results in cleaner code and reduces maintenance overhead by delegating voucher logic to the SDK. The dependency onaleph-sdk-python
is also updated to a specific branch that includes the necessary voucher features.Dependency and SDK integration:
aleph-sdk-python
dependency inpyproject.toml
to point to a specific GitHub branch (1yam-voucher-service
) that provides the required voucher functionality.VoucherManager
class and all related voucher logic fromsrc/aleph_client/voucher.py
, fully delegating voucher operations to the SDK.Codebase refactoring and simplification:
VoucherManager
insrc/aleph_client/commands/account.py
andsrc/aleph_client/commands/instance/__init__.py
with the newAuthenticatedAlephHttpClient
SDK client and itsvoucher
methods, such asget_vouchers
andfetch_vouchers_by_chain
. [1] [2] [3] [4] [5]VoucherManager
. [1] [2]These changes streamline voucher handling, leverage upstream improvements, and reduce duplicated logic in the codebase.
How to test
Notes
Depends on : aleph-im/aleph-sdk-python#225