Fix: filter on crn list & port-forwarding #239
Fix: filter on crn list & port-forwarding #239nesitor merged 4 commits intomainaleph-im/aleph-sdk-python:mainfrom 1yam-fix-port-forwarder-nullaleph-im/aleph-sdk-python:1yam-fix-port-forwarder-nullCopy head branch name to clipboard
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: |
…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-forwardingaggregate 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-forwardingaggregate 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: