iotaledger / iota-sdk

The IOTA SDK provides developers with a seamless experience to develop on IOTA by providing account abstractions and clients to interact with node APIs.
Apache License 2.0
54 stars 39 forks source link

Add computeDelegationId() to bindings utils #2168

Closed Thoralf-M closed 3 months ago

Thoralf-M commented 3 months ago

Same as computeAccountId, just another name https://github.com/iotaledger/iota-sdk/blob/c104506142e22f75c702abf2c4e901a7312c8387/bindings/python/iota_sdk/utils.py#L84 https://github.com/iotaledger/iota-sdk/blob/c104506142e22f75c702abf2c4e901a7312c8387/bindings/nodejs/lib/utils/utils.ts#L71

marc2332 commented 3 months ago

Just asking, wouldn't it be better to just rename computeAccountId to something more generic instead of having two methods calling blake2b256Hash internally? Maybe calling it blake2b256Hash :laughing:

Thoralf-M commented 3 months ago

@marc2332 also thought about that already, but then users need to know that they need to hash the output id with blake2b256 to get the id, don't you think that's asking too much?

marc2332 commented 3 months ago

@marc2332 also thought about that already, but then users need to know that they need to hash the output id with blake2b256 to get the id, don't you think that's asking too much?

Haha, fair point, it's better for DX to have context-naming even though the internal logic is the same, will do a PR

marc2332 commented 3 months ago

Ready! https://github.com/iotaledger/iota-sdk/pull/2172