Add utility functions from hub #89

Merged
jeffreypicard merged 2 commits from add_utility_funcs into master 2021-06-25 16:50:58 +02:00
jeffreypicard commented 2021-06-18 06:00:53 +02:00 (Migrated from github.com)
No description provided.
lyoshenka (Migrated from github.com) reviewed 2021-06-23 15:52:15 +02:00
lyoshenka (Migrated from github.com) commented 2021-06-23 15:52:15 +02:00

this should be called NormalizeName, since its specific to claim names

this should be called NormalizeName, since its specific to claim names
lyoshenka (Migrated from github.com) requested changes 2021-06-23 15:54:46 +02:00
lyoshenka (Migrated from github.com) left a comment

all these functions could use just a bit of documentation about what they're for

all these functions could use just a bit of documentation about what they're for
lyoshenka (Migrated from github.com) commented 2021-06-23 15:53:07 +02:00

name this TxidToHash?

name this TxidToHash?
lyoshenka (Migrated from github.com) commented 2021-06-23 15:53:32 +02:00

this should use the ReverseBytes function in this very file :-)

this should use the ReverseBytes function in this very file :-)
lyoshenka (Migrated from github.com) commented 2021-06-23 15:53:41 +02:00

ReverseBytes()

ReverseBytes()
lyoshenka (Migrated from github.com) commented 2021-06-23 15:54:23 +02:00

maybe call this TxHashToTxid()? since these are in lbry.go now, its a generic location and it's not clear what they're for

maybe call this TxHashToTxid()? since these are in lbry.go now, its a generic location and it's not clear what they're for
jeffreypicard (Migrated from github.com) reviewed 2021-06-23 19:09:49 +02:00
jeffreypicard (Migrated from github.com) commented 2021-06-23 19:09:48 +02:00

Yeah makes sense. I'm also taking a look at this function and it's only used in a print statement, nothing really relies on it, but if I understand the semantic of copy, I'm not sure it works as intended, it's copying the hash to t, then reversing the bytes on the hash, but then encoding and returning t, I think it wants to reverse the bytes on t?

Yeah makes sense. I'm also taking a look at this function and it's only used in a print statement, nothing really relies on it, but if I understand the semantic of copy, I'm not sure it works as intended, it's copying the hash to t, then reversing the bytes on the hash, but then encoding and returning t, I think it wants to reverse the bytes on t?
lyoshenka (Migrated from github.com) reviewed 2021-06-23 20:01:40 +02:00
lyoshenka (Migrated from github.com) commented 2021-06-23 20:01:40 +02:00

yea that's weird. it should reverse t. the whole point is that the reverse does it in-place so we copy to avoid messing with the original

yea that's weird. it should reverse t. the whole point is that the reverse does it in-place so we copy to avoid messing with the original
lyoshenka (Migrated from github.com) reviewed 2021-06-23 20:03:21 +02:00
lyoshenka (Migrated from github.com) commented 2021-06-23 20:03:21 +02:00

here's what should really happen: ReverseBytes should stop reversing in place. it should return a copy. or alternatively, it should be called ReverseInPlace or something. otherwise its very surprising.

here's what should really happen: ReverseBytes should stop reversing in place. it should return a copy. or alternatively, it should be called ReverseInPlace or something. otherwise its very surprising.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry.go#89
No description provided.