-
Notifications
You must be signed in to change notification settings - Fork 5
Fix: filter on crn list & port-forwarding #239
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
base: main
Are you sure you want to change the base?
Conversation
Summary: Highlight: diff --git a/src/aleph/sdk/types.py b/src/aleph/sdk/types.py
index e76aedbc..b839a14b 100644
--- a/src/aleph/sdk/types.py
+++ b/src/aleph/sdk/types.py
@@ -309,7 +309,7 @@ class Ports(BaseModel):
ports: Dict[int, PortFlags]
-AllForwarders = RootModel[Dict[ItemHash, Ports]]
+AllForwarders = RootModel[Dict[ItemHash, Optional[Ports]]]
class DictLikeModel(BaseModel): Explanation: |
required_tokens: Decimal | ||
payment_type: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required_tokens: Decimal | |
payment_type: str | |
required_tokens: Decimal | |
cost: Optional[str] | |
payment_type: str |
I think that the cost field remains to stay here, as it's part of the response.
…d_token with cost
fix: #236
and fix an issue where crn wouldn't get fetch on the crn list due to filter
Also include the fix from this other PR spotted by @RezaRahemtola (#236):
When deleting an instance, the behavior for the
ports-forwarding
aggregate is different between the CLI and the UI:null
(example: https://explorer.aleph.cloud/address/ETH/0x238224C744F4b90b4494516e074D2676ECfC6803/message/AGGREGATE/6bc45c2746f289e8fcf12fd44a0b41eae4c57ba408174cfaa63dda3ca002e2bb)The problem is that the types in the SDK (and thus in the CLI) don't expect an item hash in the
ports-forwarding
aggregate to be null (as you can see, I just added the possibility in this PR).This means that if a user deletes an instance in the UI, then the CLI won't function properly anymore, as it will throw Pydantic parsing errors when fetching the ports, for example when deleting an instance:

Unfortunately the fix is probably not as simple as adding this line: