Skip to content

Commit

Permalink
Improve chain detection
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Jun 29, 2020
1 parent 4f4cef8 commit 66ccc3e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 317 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Changelog
* Replace HIVE by STEEM and SBD by HBD only when Hive HF < 24
* Replace steem and sbd parameter names for Hive HF >= 24 by hive and hbd
* Add get follow list to Account (only for HIVE and HF >= 24)
* Add BLURT chain
* Add BLURT, SMOKE and VIZ chain_id
* Remove not used STEEM chains (STEEMZERO and STEEMAPPBASE)
* add Blurt class
* Improve chain detection
* rshares_to_token_backed_dollar, get_token_per_mvest, token_power_to_vests, token_power_to_token_backed_dollar
and vests_to_token_power have been added for chain independent usage
* New beempy command followlist, which can be used on HIVE to receive info about follow lists
Expand Down
2 changes: 0 additions & 2 deletions beem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
""" beem."""
from .steem import Steem
from .hive import Hive
from .blurt import Blurt
from .version import version as __version__
__all__ = [
"steem",
"blurt",
"account",
"amount",
"asset",
Expand Down
311 changes: 0 additions & 311 deletions beem/blurt.py

This file was deleted.

4 changes: 2 additions & 2 deletions beemapi/graphenerpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ def get_network(self, props=None):
if key[-8:] == "CHAIN_ID":
chain_id = props[key]
blockchain_name = key.split("_")[0]
elif key[-18:] == "BLOCKCHAIN_VERSION":
elif key[-13:] == "CHAIN_VERSION":
network_version = props[key]

if chain_id is None:
raise("Connecting to unknown network!")
highest_version_chain = None
for k, v in list(self.known_chains.items()):
if blockchain_name is not None and blockchain_name not in k:
if blockchain_name is not None and blockchain_name not in k and blockchain_name != "STEEMIT" and blockchain_name != "CHAIN":
continue
if v["chain_id"] == chain_id and self.version_string_to_int(v["min_version"]) <= self.version_string_to_int(network_version):
if highest_version_chain is None:
Expand Down
18 changes: 18 additions & 0 deletions beemgraphenebase/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
{"asset": "VESTS", "symbol": "VESTS", "precision": 6, "id": 2}
],
},
"VIZ": {
"chain_id": "2040effda178d4fffff5eab7a915d4019879f5205cc5392e4bcced2b6edda0cd",
"min_version": "2.5.0",
"prefix": "VIZ",
"chain_assets": [
{"asset": "STEEM", "symbol": "VIZ", "precision": 3, "id": 1},
{"asset": "VESTS", "symbol": "VESTS", "precision": 6, "id": 2}
],
},
"WEKU": {
"chain_id": "b24e09256ee14bab6d58bfa3a4e47b0474a73ef4d6c47eeea007848195fa085e",
"min_version": "0.19.3",
Expand All @@ -93,6 +102,15 @@
{"asset": "VESTS", "symbol": "VESTS", "precision": 6, "id": 2}
],
},
"SMOKE": {
"chain_id": "1ce08345e61cd3bf91673a47fc507e7ed01550dab841fd9cdb0ab66ef576aaf0",
"min_version": "0.1.0",
"prefix": "SMK",
"chain_assets": [
{"asset": "STEEM", "symbol": "SMOKE", "precision": 3, "id": 1},
{"asset": "VESTS", "symbol": "VESTS", "precision": 6, "id": 2}
],
},
"EFTGAPPBASE": {
"chain_id": "1c15984beb16945c01cb9bc3d654b0417c650461dfe535018fe03a4fc5a36864",
"min_version": "0.19.12",
Expand Down

0 comments on commit 66ccc3e

Please sign in to comment.