Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix simple timestamp records broken OP_RETURN data if the prefix or data of Simple#set_data contain a single hexadecimal digit #179

Merged
merged 2 commits into from
Sep 21, 2023

Conversation

rantan
Copy link
Contributor

@rantan rantan commented Sep 20, 2023

Glueby::Contract::TimestampTxBuilder::Simple#set_data の引数に HEX で1桁になる \u0001 のような文字が含まれる場合に、2桁めの 0 が消えて桁がずれる問題を修正しました。

…ata of Simple#set_data contain a single hexadecimal digit
@azuchi azuchi requested a review from Yamaguchi September 21, 2023 02:16
@@ -23,7 +23,7 @@ def set_data(prefix, data)
@data = data

contents = [prefix, data].map do |content|
content.bytes.map { |i| i.to_s(16) }.join
content.unpack1('H*')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content.bthのほうが少し簡単です。

contents = [prefix, data].map(&:bth)

spec/glueby/contract/timestamp/tx_builder/simple_spec.rb Outdated Show resolved Hide resolved
spec/glueby/contract/timestamp/tx_builder/simple_spec.rb Outdated Show resolved Hide resolved
@rantan rantan merged commit 71d992e into chaintope:master Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants