Skip to content

Commit b098d24

Browse files
committed
Added: Binary data from raw_call, and masternode_list_conf
New version: 0.9b15
1 parent e8ac3ac commit b098d24

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.9b13] - 2023-06-23
8+
## [0.9b15] - 2023-06-15
9+
Public beta release 15.
10+
Added binary data from raw_call, and masternode_list_conf
11+
12+
## [0.9b13] - 2023-06-05
913
Public beta release 13
1014

11-
## [0.9b2] - 2023-06-21
15+
## [0.9b2] - 2023-06-01
1216
Private beta release 2
1317

1418
## [0.0.1] - 2021-03-08

boli_orbital_api/rpc.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
__copyright__: "2018-2023"
99
__credits__: [""]
1010
__license__: "MIT"
11-
__version__: 0.9b14
11+
__version__: 0.9b15
1212
__maintainer__: "Asdrúbal Velásquez Lagrave"
1313
__email__: "hello@orbital.center"
1414
__status__: "BETA"
@@ -33,7 +33,7 @@
3333
"VERSION",
3434
]
3535

36-
VERSION = "0.9b14"
36+
VERSION = "0.9b15"
3737

3838
# LOGGER
3939
logger = setup_logger(__name__)
@@ -750,7 +750,7 @@ def masternode_list_conf(self) -> dict:
750750
Print masternode.conf in JSON format
751751
masternode list-conf
752752
"""
753-
return _process_result(self.raw_call("masternode", params=['list-conf']))
753+
return _process_result(self.raw_call("masternode", params=['list-conf'], return_binary=True))
754754

755755
def masternode_start_alias(self, alias) -> dict:
756756
"""
@@ -1170,19 +1170,25 @@ def raw_call(
11701170
self,
11711171
method: str,
11721172
params=None,
1173+
return_binary=False
11731174
) -> Any:
11741175
""" Rpc communication raw_call main method
11751176
11761177
It will return:
1177-
# OK
1178+
# OK JSON
11781179
{"result": response.json()['result'], 'errors': None} When OK
11791180
1181+
# OK BINARY
1182+
{"result": response.content, 'errors': None} When OK
1183+
11801184
# Server responds but NOT OK
11811185
{"result": response.json()['result'], 'errors': None} When server responds but error in command or sintaxis
11821186
11831187
# NO connect or communication fail
11841188
{"result": response, 'errors': f'{e}'}
11851189
1190+
return_binary: Some methods prefer use binary version instead JSON
1191+
11861192
"""
11871193

11881194
self._data["params"] = [] if params is None else params
@@ -1201,11 +1207,12 @@ def raw_call(
12011207
auth=(self.rpc_user, self.rpc_password)
12021208
)
12031209

1204-
# print("raw_call_result", response.status_code, response.json())
1205-
12061210
if response.status_code == 200:
12071211
self._valid_node = True
1208-
return {"result": response.json()['result'], 'errors': None}
1212+
if return_binary:
1213+
return {"result": response.content, 'errors': None}
1214+
else:
1215+
return {"result": response.json()['result'], 'errors': None}
12091216

12101217
else:
12111218
self._valid_node = False

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "boli_orbital_api"
3-
version = "0.9b14"
3+
version = "0.9b15"
44
description = "Orbital API RPC for Bolivarcoin/Bolicoin blockchain"
55
authors = ["Asdrubal Velasquez Lagrave <hello@orbital.center>"]
66
maintainers = ["Asdrubal Velasquez Lagrave <hello@orbital.center>"]

0 commit comments

Comments
 (0)