Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Yamaguchi <[email protected]>
  • Loading branch information
rantan and Yamaguchi committed Sep 21, 2023
1 parent a9c8dbd commit 7ba469a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions lib/glueby/contract/timestamp/tx_builder/simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ def set_data(prefix, data)
@prefix = prefix
@data = data

contents = [prefix, data].map do |content|
content.unpack1('H*')
end

contents = [prefix, data].map(&:bth)
@txb.data(*contents)
self
end
Expand Down
4 changes: 2 additions & 2 deletions spec/glueby/contract/timestamp/tx_builder/simple_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
end

context 'it gets a prefix that has a single hexadecimal digit' do
let(:prefix) { 'prefix' }
let(:prefix) { "prefix\x01" }

it 'set correct OP_RETURN data' do
tx = builder.build
Expand All @@ -103,7 +103,7 @@
end

context 'it gets a content that has a single hexadecimal digit' do
let(:content) { 'content' }
let(:content) { "content\x01" }

it 'set correct OP_RETURN data' do
tx = builder.build
Expand Down

0 comments on commit 7ba469a

Please sign in to comment.