fireblocks / fireblocks-sdk-py

Official Python SDK for Fireblocks API
http://docs.fireblocks.com/api/swagger-ui/
MIT License
52 stars 41 forks source link

Invalid handling of `idempotency_key` in `create_vault_asset` method #46

Closed danie1k closed 3 years ago

danie1k commented 3 years ago

Second parameter of _post_request() is body, not a idempotency_key: https://github.com/fireblocks/fireblocks-sdk-py/blob/7a70d374f4e20f1ca347b432217fba41971eee77/fireblocks_sdk/sdk.py#L1105

So the following code is invalid: https://github.com/fireblocks/fireblocks-sdk-py/blob/7a70d374f4e20f1ca347b432217fba41971eee77/fireblocks_sdk/sdk.py#L549

There should be either:

return self._post_request(f"/v1/vault/accounts/{vault_account_id}/{asset_id}", {}, idempotency_key)

or

return self._post_request(f"/v1/vault/accounts/{vault_account_id}/{asset_id}", idempotency_key=idempotency_key)
danie1k commented 3 years ago

For the record, fixed in https://github.com/fireblocks/fireblocks-sdk-py/commit/c638e92eaca11b41701c985b9194f3d36468c45d & https://github.com/fireblocks/fireblocks-sdk-py/releases/tag/v1.6.7