diff --git a/hive-ruby.gemspec b/hive-ruby.gemspec index d8a2f1bee0d327c4f35eae5b26a20b83737f8f53..663fabdd5850f247901106df19d494663192fed1 100644 --- a/hive-ruby.gemspec +++ b/hive-ruby.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'json', '~> 2.1', '>= 2.1.0' spec.add_dependency 'logging', '~> 2.2', '>= 2.2.0' - spec.add_dependency 'hashie', '~> 3.5', '>= 3.5.7' + spec.add_dependency 'hashie', '~> 4.1', '>= 3.5.7' spec.add_dependency 'bitcoin-ruby', '~> 0.0', '0.0.20' spec.add_dependency 'ffi', '~> 1.9', '>= 1.9.23' spec.add_dependency 'bindata', '~> 2.4', '>= 2.4.4' diff --git a/lib/hive/version.rb b/lib/hive/version.rb index 5ea2b2329ed1fbe5827159562f6f74f115b2ca93..45df482ded5f31492ce57fd57edd130ca2c1db98 100644 --- a/lib/hive/version.rb +++ b/lib/hive/version.rb @@ -1,4 +1,4 @@ module Hive - VERSION = '1.0.1' + VERSION = '1.0.2' AGENT_ID = "hive-ruby/#{VERSION}" end diff --git a/test/hive/account_history_api_test.rb b/test/hive/account_history_api_test.rb index 65c29e9881151107c1eda57b23b570de9ceb666a..c61dfc307429f9563d6f0e92366e44d398c62041 100644 --- a/test/hive/account_history_api_test.rb +++ b/test/hive/account_history_api_test.rb @@ -43,6 +43,40 @@ module Hive end end + def test_get_account_history_with_op_mask + vcr_cassette('account_history_api_get_account_history_with_op_mask', record: :once) do + # We're looking specifically for comment_operation, therefore, for the + # first 64 operation types (as defined in protocol/operations.hpp), we set + # the corresponding bit in operation_filter_low; for the higher-numbered + # operations, set the bit in operation_filter_high (pretending + # operation_filter is a 128-bit bitmask composed of + # {operation_filter_high, operation_filter_low}) + # + # Note, we don't really use the operation_filter_high because + # comment_operation is the second flag. In fact, operation_filter_high + # could even be nil, if we wanted. + # + # https://gitlab.syncad.com/hive/hive/-/blob/master/libraries/protocol/include/hive/protocol/operations.hpp + + operation_mask = 0x02 # comment_operation + operation_filter_low = operation_mask & 0xFFFFFFFF + operation_filter_high = (operation_mask & 0xFFFFFFFF00000000) >> 32 + + options = { + account: 'hiveio', + start: 0, + limit: 0, + include_reversible: true, + operation_filter_low: operation_filter_low, + operation_filter_high: operation_filter_high + } + + @api.get_account_history(options) do |result| + assert_equal Hashie::Array, result.history.class + end + end + end + def test_get_ops_in_block vcr_cassette('account_history_api_get_ops_in_block', record: :once) do options = {