File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,10 @@ def get_block(self, block=None):
77
77
if block == 'latest' :
78
78
return self .get_current_block ()
79
79
80
- if type (block ) is str :
80
+ if len (block ) == 64 :
81
81
return self .get_block_by_hash (block )
82
82
83
- return self .get_block_by_number (block )
83
+ return self .get_block_by_number (int ( block ) )
84
84
85
85
def get_block_by_hash (self , hash_block ):
86
86
"""Query block by ID
@@ -94,7 +94,7 @@ def get_block_by_hash(self, hash_block):
94
94
"""
95
95
return self .full_node .request ('/wallet/getblockbyid' , {
96
96
'value' : hash_block
97
- })
97
+ }, 'post' )
98
98
99
99
def get_block_by_number (self , block_id ):
100
100
"""Query block by height
@@ -111,7 +111,7 @@ def get_block_by_number(self, block_id):
111
111
112
112
return self .full_node .request ('/wallet/getblockbynum' , {
113
113
'num' : int (block_id )
114
- })
114
+ }, 'post' )
115
115
116
116
def get_block_transaction_count (self , block = None ):
117
117
"""Total number of transactions in a block
You can’t perform that action at this time.
0 commit comments