diff --git a/lib/glueby/contract/timestamp/tx_builder/simple.rb b/lib/glueby/contract/timestamp/tx_builder/simple.rb index 5148dbe..70d6c4c 100644 --- a/lib/glueby/contract/timestamp/tx_builder/simple.rb +++ b/lib/glueby/contract/timestamp/tx_builder/simple.rb @@ -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 diff --git a/spec/glueby/contract/timestamp/tx_builder/simple_spec.rb b/spec/glueby/contract/timestamp/tx_builder/simple_spec.rb index 0014c5a..60d8861 100644 --- a/spec/glueby/contract/timestamp/tx_builder/simple_spec.rb +++ b/spec/glueby/contract/timestamp/tx_builder/simple_spec.rb @@ -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 @@ -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