From 8fa18414d644fd600b4864c2c3181e8f527f355e Mon Sep 17 00:00:00 2001
From: inertia <amartin75@gmail.com>
Date: Fri, 6 Nov 2020 16:08:42 -0500
Subject: [PATCH] gem bump; version bump

---
 hive-ruby.gemspec                     |  2 +-
 lib/hive/version.rb                   |  2 +-
 test/hive/account_history_api_test.rb | 34 +++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/hive-ruby.gemspec b/hive-ruby.gemspec
index d8a2f1b..663fabd 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 5ea2b23..45df482 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 65c29e9..c61dfc3 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 = {
-- 
GitLab