Skip to content

Commit

Permalink
fix KvstoreUtils.get for compatibility with old versions
Browse files Browse the repository at this point in the history
  • Loading branch information
portuu3 committed Aug 23, 2024
1 parent a707c5e commit 29df37a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get(chain_id: ChainId, address: str, key: str) -> str:
or "kvstores" not in kvstore_data["data"]
or len(kvstore_data["data"]["kvstores"]) == 0
):
raise KVStoreClientError(f"Key '{key}' not found for address {address}")
return ""

return kvstore_data["data"]["kvstores"][0]["value"]

Expand Down
6 changes: 2 additions & 4 deletions packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,10 @@ export class KVStoreUtils {
);

if (!kvstores || kvstores.length === 0) {
throw new Error(`Key "${key}" not found for address ${address}`);
return '';
}

const value = kvstores[0].value;

return value;
return kvstores[0].value;
}

/**
Expand Down

0 comments on commit 29df37a

Please sign in to comment.