hive-nectar 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hive-nectar might be problematic. Click here for more details.
- {hive_nectar-0.1.2.dist-info → hive_nectar-0.1.3.dist-info}/METADATA +1 -2
- {hive_nectar-0.1.2.dist-info → hive_nectar-0.1.3.dist-info}/RECORD +22 -21
- nectar/account.py +86 -35
- nectar/block.py +2 -1
- nectar/blockchain.py +2 -2
- nectar/blockchaininstance.py +11 -1
- nectar/cli.py +292 -266
- nectar/comment.py +19 -16
- nectar/haf.py +380 -0
- nectar/hivesigner.py +9 -0
- nectar/market.py +2 -4
- nectar/memo.py +2 -2
- nectar/nodelist.py +0 -24
- nectar/utils.py +60 -37
- nectar/version.py +1 -1
- nectarapi/version.py +1 -1
- nectarbase/version.py +1 -1
- nectargraphenebase/account.py +1 -2
- nectargraphenebase/version.py +1 -1
- {hive_nectar-0.1.2.dist-info → hive_nectar-0.1.3.dist-info}/WHEEL +0 -0
- {hive_nectar-0.1.2.dist-info → hive_nectar-0.1.3.dist-info}/entry_points.txt +0 -0
- {hive_nectar-0.1.2.dist-info → hive_nectar-0.1.3.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hive-nectar
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Hive Blockchain Python Library
|
|
5
5
|
Project-URL: Homepage, http://www.github.com/thecrazygm/hive-nectar
|
|
6
6
|
Project-URL: Download, https://github.com/thecrazygm/hive-nectar/tarball/0.1.0b
|
|
@@ -48,7 +48,6 @@ Requires-Python: >=3.10
|
|
|
48
48
|
Requires-Dist: appdirs
|
|
49
49
|
Requires-Dist: asn1crypto
|
|
50
50
|
Requires-Dist: click
|
|
51
|
-
Requires-Dist: click-shell
|
|
52
51
|
Requires-Dist: cryptography
|
|
53
52
|
Requires-Dist: diff-match-patch
|
|
54
53
|
Requires-Dist: ecdsa
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
nectar/__init__.py,sha256=zy2BLTHFDp70FCUzqxOJfXIbII78Md9FHcHYiSkvmLA,458
|
|
2
|
-
nectar/account.py,sha256=
|
|
2
|
+
nectar/account.py,sha256=V4yHwiPxLfkSYaaEqGRz5Dt6hF3xG4XKGVdHb5k2eKE,193895
|
|
3
3
|
nectar/amount.py,sha256=ZEECuR_2uwcwjaenXl96yPAv2w3X_Cs2ZU-X-_44tL8,21688
|
|
4
4
|
nectar/asciichart.py,sha256=DwPyZAqne6o9L_PPRtlw6Xj0QdOZ-aId1lpOnmbyc6Q,8828
|
|
5
5
|
nectar/asset.py,sha256=sxrxLb4yP3pwvs3gcHBeN68zH57kFmsvd6FsDb08u2k,2732
|
|
6
|
-
nectar/block.py,sha256=
|
|
7
|
-
nectar/blockchain.py,sha256=
|
|
8
|
-
nectar/blockchaininstance.py,sha256=
|
|
6
|
+
nectar/block.py,sha256=_E6VvRnKNX71mtEqkNvmE056W47ILtUShGfxczmfsyQ,17721
|
|
7
|
+
nectar/blockchain.py,sha256=emYKvsxBN8AeQAYq_vDj3LemWfLJoWyvvytt0avz_QA,49489
|
|
8
|
+
nectar/blockchaininstance.py,sha256=4S6yFGHeZRdRtTN3A1B-DbQj3fDrDFBH5M1l4DbPMUY,105406
|
|
9
9
|
nectar/blockchainobject.py,sha256=fq_ocT_So0y5neZzs8v_LmBfKlvDdXwsBj3_ZvO7fkg,8660
|
|
10
|
-
nectar/cli.py,sha256=
|
|
11
|
-
nectar/comment.py,sha256=
|
|
10
|
+
nectar/cli.py,sha256=cakZ6FReSQUVpLxHIsya0nNcquTGUbG_7Dm2W0EyiEM,214710
|
|
11
|
+
nectar/comment.py,sha256=W7NOKsQS1UucJAZ01yyHw8_71YANEbzB6NApSr0CQtM,59182
|
|
12
12
|
nectar/community.py,sha256=exeYHRLfLfzylZn-dL8A-XLfO2__gd3GE4Zg2Nq9fes,31810
|
|
13
13
|
nectar/constants.py,sha256=d_B4XfCeCysvczThCtBjrMpuKwFXZ0_xmBvCIyI4FhU,4498
|
|
14
14
|
nectar/discussions.py,sha256=Nb-i_9ltLLz8gBJbPgNle6J68w906NP_aBr-LLL3has,109187
|
|
15
15
|
nectar/exceptions.py,sha256=AKA75cDNnpioZPe2XcNWvyAVPRLcHBfPyBwjYVFOJC0,2884
|
|
16
|
+
nectar/haf.py,sha256=uE_9UZEaeZ1EXrXlWc5QgBuz2ijgeskJDDet56EruhM,13570
|
|
16
17
|
nectar/hive.py,sha256=PIOuWjg1cY2fAwf9AT3DCj7i3Tk1AGN3oHzRNvi1OwM,27597
|
|
17
|
-
nectar/hivesigner.py,sha256=
|
|
18
|
+
nectar/hivesigner.py,sha256=QLvIg6in2GZjrQS3BJM7vsC1wU3qCmgLRogruaBICwQ,17884
|
|
18
19
|
nectar/imageuploader.py,sha256=Qz1N1BPjuQVvh1SUItyZLwGVc8xYXxmnrADVpWPld6E,3436
|
|
19
20
|
nectar/instance.py,sha256=JwHluHm1hUtjylUAqkB9IubGxyIeyCmAIpwLW1_qz6M,2718
|
|
20
|
-
nectar/market.py,sha256=
|
|
21
|
-
nectar/memo.py,sha256=
|
|
21
|
+
nectar/market.py,sha256=siUc2jU_E_q_E0wKb0ktnznPuSeXOESntuspOC4Rtbk,38944
|
|
22
|
+
nectar/memo.py,sha256=v33ri4qh6p5-QGuFpD6R0AS1hRafrirOy3eEbLZT7nw,19989
|
|
22
23
|
nectar/message.py,sha256=m53YjIY9gAXN7kjxREoeMkRxVIsyQuqRwj_Yk-Uclp4,13641
|
|
23
|
-
nectar/nodelist.py,sha256=
|
|
24
|
+
nectar/nodelist.py,sha256=uFbMpN0_dGKwvjntA-49atAcLaT3MmXg9y0t0GJ7ycU,21457
|
|
24
25
|
nectar/price.py,sha256=5TLcWREki2Jl4U9xL6V6_a9jW8c974aJqL7EANEeuDs,22730
|
|
25
26
|
nectar/profile.py,sha256=loVIWX2CBtMqaVB-jRJeUD3uhF_0pMflqIYI0pRbZXY,2170
|
|
26
27
|
nectar/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -28,8 +29,8 @@ nectar/rc.py,sha256=EKiL1Hw2YhTj0zlwbjJEsRGtyNNw7WVMrtWgCvR7Zaw,14407
|
|
|
28
29
|
nectar/snapshot.py,sha256=z6qsTTZ0sJuP9fCVVwg1AUjAA3pjl9V9uouYUJJhywo,40967
|
|
29
30
|
nectar/storage.py,sha256=B_V_rD3xHArNfzyOMd9uKaI0qQpB9odj67iMkwDSsY0,2788
|
|
30
31
|
nectar/transactionbuilder.py,sha256=Ji5jIKDIY1-h40obTdJIfpBPdPt_QozUaLqH3HrEF8A,31663
|
|
31
|
-
nectar/utils.py,sha256=
|
|
32
|
-
nectar/version.py,sha256=
|
|
32
|
+
nectar/utils.py,sha256=HWDNg3bZmsczvrgImzSrAajJEvIxtdYkf75eBaQaTok,21070
|
|
33
|
+
nectar/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
|
|
33
34
|
nectar/vote.py,sha256=26OzZUw3ZNKbLFQ766vv32qMxiDld94csEjMGzeU4WU,28641
|
|
34
35
|
nectar/wallet.py,sha256=VUxsKLveb4QokfAEDQFAkxZgmiWAppqFhHOm2ayBlH4,16777
|
|
35
36
|
nectar/witness.py,sha256=lNk3CwHI21HDrckPUF1D6CTZp7HEFSoT_l4XmXnAtKY,29155
|
|
@@ -40,7 +41,7 @@ nectarapi/node.py,sha256=mjK-fMFJ2icDaOUBoiUuDU-beo3aQK0HGwt0l0pC0YQ,5456
|
|
|
40
41
|
nectarapi/noderpc.py,sha256=K96Mt5g5-T3npfFZoWmVl0xhFfifUrlxpQml3AixlFE,10767
|
|
41
42
|
nectarapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
43
|
nectarapi/rpcutils.py,sha256=OQQPApgzViYggeVrRKeQ15w6iWzUeIHI11rpNv4oMJQ,3096
|
|
43
|
-
nectarapi/version.py,sha256=
|
|
44
|
+
nectarapi/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
|
|
44
45
|
nectarbase/__init__.py,sha256=O11coqB-Woq_yp946kA1b8hzqSdDcK9j9gwenx7d6JE,253
|
|
45
46
|
nectarbase/ledgertransactions.py,sha256=_1vNbybdT2kGBisQJfaP0ZJHLabV7VD6_Us0Hf30cD0,3773
|
|
46
47
|
nectarbase/memo.py,sha256=Ix5Uhan7x2rz54_QMSQ-Z5rZz-FqvR3i13H3cGEnPIY,7496
|
|
@@ -51,11 +52,11 @@ nectarbase/operations.py,sha256=k6tYdFjebs__sIjz1cZ5k9P-X52HNdT9aSFy7KKG6mI,5242
|
|
|
51
52
|
nectarbase/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
53
|
nectarbase/signedtransactions.py,sha256=0YpmcU0hEx7rALV9IbXgk6W2ilmBzbo12dveqSlL_TI,3541
|
|
53
54
|
nectarbase/transactions.py,sha256=D7TK4Pkxr1N7p0Yh2bxvdXpOuEYpLl2tWK84Pj_93c0,319
|
|
54
|
-
nectarbase/version.py,sha256=
|
|
55
|
+
nectarbase/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
|
|
55
56
|
nectargrapheneapi/__init__.py,sha256=_Gxdt_qaQQwwYABHEFBuf4tMh93ItIa3HPBH9nk1PTw,151
|
|
56
57
|
nectargrapheneapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
58
|
nectargraphenebase/__init__.py,sha256=66IxULO3eMKcx-nRDFDLz0YfEvXCkty08xjt9M1WgyY,577
|
|
58
|
-
nectargraphenebase/account.py,sha256=
|
|
59
|
+
nectargraphenebase/account.py,sha256=o81CDtNzEefyZeHYWTx677qKG7mb82jNEFkdX2FVK0o,38547
|
|
59
60
|
nectargraphenebase/aes.py,sha256=BywHJR8F7n2IBXhBmXqyc61DlVXcJ_QIE9qkubFdX2M,1578
|
|
60
61
|
nectargraphenebase/base58.py,sha256=7ilcjbwV3YGDL3a5MCilR03P-p5kNVafrmsRsftr0d8,5410
|
|
61
62
|
nectargraphenebase/bip32.py,sha256=UjqgbBvvdya3gQRD73ccdfEQL4brxs4DWhM9vTvRMpc,16023
|
|
@@ -72,7 +73,7 @@ nectargraphenebase/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
72
73
|
nectargraphenebase/signedtransactions.py,sha256=rhFEQDNcOau08qnNAf_3UxJDXtIpi5Y8tOFDXZK1bPw,7119
|
|
73
74
|
nectargraphenebase/types.py,sha256=d_4asPAmcQ61dmsXEAsXalUElAPfdmKBMuL6OMIysvI,10237
|
|
74
75
|
nectargraphenebase/unsignedtransactions.py,sha256=02jtLuTp-xNV1ujNOmMoUvx364kLMT5x7txeWeA_PJE,9238
|
|
75
|
-
nectargraphenebase/version.py,sha256=
|
|
76
|
+
nectargraphenebase/version.py,sha256=VafjOiCwpEB6BLoFUPsL7S2nniZfzWT-A42sbQewV6Y,76
|
|
76
77
|
nectarstorage/__init__.py,sha256=nEM9OMoHqHPS6IoV_JzVyxPRORz0DCeS7Yv-MwjmWoQ,1772
|
|
77
78
|
nectarstorage/base.py,sha256=h7Oca1_RaJw39P1I_xXRKup016pS8zCLOs3e4IHKKdE,9734
|
|
78
79
|
nectarstorage/exceptions.py,sha256=0erk_d0Ejia9td_Ke7XFBl17H1BxbM42gFpkej8EbV0,421
|
|
@@ -81,8 +82,8 @@ nectarstorage/masterpassword.py,sha256=xOAOZvVfIctfGiwIed_XpKnWcGDla95qp8osTLyYY
|
|
|
81
82
|
nectarstorage/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
83
|
nectarstorage/ram.py,sha256=Cy6JbMrlgcEG673_KqfyaofhAdJR-luRKTedj3qTZEE,1034
|
|
83
84
|
nectarstorage/sqlite.py,sha256=ZKJxPL0AZjJIlwjxCEh6GGcjQzlBPuWs6tj40oPZz3M,10635
|
|
84
|
-
hive_nectar-0.1.
|
|
85
|
-
hive_nectar-0.1.
|
|
86
|
-
hive_nectar-0.1.
|
|
87
|
-
hive_nectar-0.1.
|
|
88
|
-
hive_nectar-0.1.
|
|
85
|
+
hive_nectar-0.1.3.dist-info/METADATA,sha256=Mdxii-IuD2qmXCZQnsBF5mBZxVKuOSnjIBR1Cbqx0Bo,6219
|
|
86
|
+
hive_nectar-0.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
87
|
+
hive_nectar-0.1.3.dist-info/entry_points.txt,sha256=DbqiJb5fFpQvGZ0ojvc2w3dXZitTg6FPz09CobKq4m8,47
|
|
88
|
+
hive_nectar-0.1.3.dist-info/licenses/LICENSE.txt,sha256=WjJRNR4r7FuLEO2BTBLGa05T7bBecGGgH47NgKsSY0E,1158
|
|
89
|
+
hive_nectar-0.1.3.dist-info/RECORD,,
|
nectar/account.py
CHANGED
|
@@ -29,6 +29,7 @@ from nectargraphenebase.account import PasswordKey, PublicKey
|
|
|
29
29
|
from .blockchain import Blockchain
|
|
30
30
|
from .blockchainobject import BlockchainObject
|
|
31
31
|
from .exceptions import AccountDoesNotExistsException, OfflineHasNoRPCException
|
|
32
|
+
from .haf import HAF
|
|
32
33
|
from .utils import (
|
|
33
34
|
addTzInfo,
|
|
34
35
|
formatTimedelta,
|
|
@@ -613,26 +614,41 @@ class Account(BlockchainObject):
|
|
|
613
614
|
"""
|
|
614
615
|
Return the account's normalized reputation score.
|
|
615
616
|
|
|
616
|
-
If the node is offline, returns
|
|
617
|
+
If the node is offline, returns a default reputation score. When connected, tries the HAF reputation API first
|
|
618
|
+
which returns the final normalized score directly. Falls back to the cached reputation
|
|
619
|
+
field if HAF fails.
|
|
617
620
|
"""
|
|
618
621
|
if not self.blockchain.is_connected():
|
|
619
|
-
return
|
|
620
|
-
|
|
621
|
-
|
|
622
|
+
return reputation_to_score(0)
|
|
623
|
+
|
|
624
|
+
# Try HAF API first - returns final normalized score
|
|
625
|
+
haf = HAF(blockchain_instance=self.blockchain)
|
|
626
|
+
rep_data = haf.reputation(self["name"])
|
|
627
|
+
if rep_data is not None:
|
|
628
|
+
# Handle both dict and direct responses
|
|
622
629
|
try:
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
)
|
|
626
|
-
|
|
627
|
-
rep = int(rep[0]["reputation"])
|
|
628
|
-
except Exception:
|
|
629
|
-
if "reputation" in self:
|
|
630
|
-
rep = int(self["reputation"])
|
|
630
|
+
if isinstance(rep_data, dict) and "reputation" in rep_data:
|
|
631
|
+
return float(rep_data["reputation"])
|
|
632
|
+
elif isinstance(rep_data, (int, float)):
|
|
633
|
+
return float(rep_data)
|
|
631
634
|
else:
|
|
632
|
-
|
|
635
|
+
# Try to convert to float if it's a string
|
|
636
|
+
return float(rep_data)
|
|
637
|
+
except (ValueError, TypeError, KeyError) as e:
|
|
638
|
+
log.warning(f"Failed to parse reputation data from HAF for {self['name']}: {e}")
|
|
639
|
+
|
|
640
|
+
# Fallback to cached reputation field (old behavior)
|
|
641
|
+
if "reputation" in self:
|
|
642
|
+
try:
|
|
643
|
+
rep = int(self["reputation"])
|
|
644
|
+
log.debug(f"Using cached reputation for {self['name']}: {rep}")
|
|
645
|
+
return reputation_to_score(rep)
|
|
646
|
+
except (ValueError, TypeError) as e:
|
|
647
|
+
log.warning(f"Invalid cached reputation for {self['name']}: {e}")
|
|
648
|
+
return reputation_to_score(0)
|
|
633
649
|
else:
|
|
634
|
-
|
|
635
|
-
|
|
650
|
+
log.warning(f"No reputation data available for {self['name']}")
|
|
651
|
+
return reputation_to_score(0)
|
|
636
652
|
|
|
637
653
|
def get_manabar(self):
|
|
638
654
|
"""
|
|
@@ -999,14 +1015,12 @@ class Account(BlockchainObject):
|
|
|
999
1015
|
raise AssertionError(
|
|
1000
1016
|
"Should input %s, not any other asset!" % self.blockchain.backed_token_symbol
|
|
1001
1017
|
)
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
hive_power=token_power,
|
|
1009
|
-
)
|
|
1018
|
+
vote_pct = self.blockchain.rshares_to_vote_pct(
|
|
1019
|
+
self.blockchain.hbd_to_rshares(token_units, not_broadcasted_vote=not_broadcasted_vote),
|
|
1020
|
+
post_rshares=post_rshares,
|
|
1021
|
+
voting_power=voting_power * 100,
|
|
1022
|
+
hive_power=token_power,
|
|
1023
|
+
)
|
|
1010
1024
|
return vote_pct
|
|
1011
1025
|
|
|
1012
1026
|
def get_creator(self):
|
|
@@ -1282,6 +1296,8 @@ class Account(BlockchainObject):
|
|
|
1282
1296
|
unread_notes = self.blockchain.rpc.unread_notifications(
|
|
1283
1297
|
{"account": account}, api="bridge"
|
|
1284
1298
|
)
|
|
1299
|
+
if unread_notes is None:
|
|
1300
|
+
return []
|
|
1285
1301
|
if limit is None or limit > unread_notes["unread"]:
|
|
1286
1302
|
limit = unread_notes["unread"]
|
|
1287
1303
|
if limit is None or limit == 0:
|
|
@@ -1558,7 +1574,12 @@ class Account(BlockchainObject):
|
|
|
1558
1574
|
if not self.blockchain.is_connected():
|
|
1559
1575
|
raise OfflineHasNoRPCException("No RPC available in offline mode!")
|
|
1560
1576
|
self.blockchain.rpc.set_next_node_on_empty_reply(True)
|
|
1561
|
-
|
|
1577
|
+
subscriptions = self.blockchain.rpc.list_all_subscriptions(
|
|
1578
|
+
{"account": account}, api="bridge"
|
|
1579
|
+
)
|
|
1580
|
+
if subscriptions is None:
|
|
1581
|
+
return []
|
|
1582
|
+
return subscriptions
|
|
1562
1583
|
|
|
1563
1584
|
def get_account_posts(self, sort="feed", limit=20, account=None, observer=None, raw_data=False):
|
|
1564
1585
|
"""Returns account feed"""
|
|
@@ -4018,7 +4039,9 @@ class Account(BlockchainObject):
|
|
|
4018
4039
|
else:
|
|
4019
4040
|
return self.blockchain.finalizeOp(op, account, "active", **kwargs)
|
|
4020
4041
|
|
|
4021
|
-
def disallow(
|
|
4042
|
+
def disallow(
|
|
4043
|
+
self, foreign, permission="posting", account=None, weight=None, threshold=None, **kwargs
|
|
4044
|
+
):
|
|
4022
4045
|
"""Remove additional access to an account by some other public
|
|
4023
4046
|
key or account.
|
|
4024
4047
|
|
|
@@ -4041,19 +4064,47 @@ class Account(BlockchainObject):
|
|
|
4041
4064
|
|
|
4042
4065
|
try:
|
|
4043
4066
|
pubkey = PublicKey(foreign, prefix=self.blockchain.prefix)
|
|
4044
|
-
|
|
4045
|
-
authority["key_auths"] = list(
|
|
4046
|
-
[x for x in authority["key_auths"] if x[0] != str(pubkey)]
|
|
4047
|
-
)
|
|
4048
|
-
except Exception:
|
|
4049
|
-
try:
|
|
4050
|
-
foreign_account = Account(foreign, blockchain_instance=self.blockchain)
|
|
4067
|
+
if weight:
|
|
4051
4068
|
affected_items = list(
|
|
4052
|
-
[x for x in authority["
|
|
4069
|
+
[x for x in authority["key_auths"] if x[0] == str(pubkey) and x[1] == weight]
|
|
4070
|
+
)
|
|
4071
|
+
authority["key_auths"] = list(
|
|
4072
|
+
[
|
|
4073
|
+
x
|
|
4074
|
+
for x in authority["key_auths"]
|
|
4075
|
+
if not (x[0] == str(pubkey) and x[1] == weight)
|
|
4076
|
+
]
|
|
4053
4077
|
)
|
|
4054
|
-
|
|
4055
|
-
|
|
4078
|
+
else:
|
|
4079
|
+
affected_items = list([x for x in authority["key_auths"] if x[0] == str(pubkey)])
|
|
4080
|
+
authority["key_auths"] = list(
|
|
4081
|
+
[x for x in authority["key_auths"] if x[0] != str(pubkey)]
|
|
4056
4082
|
)
|
|
4083
|
+
except Exception:
|
|
4084
|
+
try:
|
|
4085
|
+
foreign_account = Account(foreign, blockchain_instance=self.blockchain)
|
|
4086
|
+
if weight:
|
|
4087
|
+
affected_items = list(
|
|
4088
|
+
[
|
|
4089
|
+
x
|
|
4090
|
+
for x in authority["account_auths"]
|
|
4091
|
+
if x[0] == foreign_account["name"] and x[1] == weight
|
|
4092
|
+
]
|
|
4093
|
+
)
|
|
4094
|
+
authority["account_auths"] = list(
|
|
4095
|
+
[
|
|
4096
|
+
x
|
|
4097
|
+
for x in authority["account_auths"]
|
|
4098
|
+
if not (x[0] == foreign_account["name"] and x[1] == weight)
|
|
4099
|
+
]
|
|
4100
|
+
)
|
|
4101
|
+
else:
|
|
4102
|
+
affected_items = list(
|
|
4103
|
+
[x for x in authority["account_auths"] if x[0] == foreign_account["name"]]
|
|
4104
|
+
)
|
|
4105
|
+
authority["account_auths"] = list(
|
|
4106
|
+
[x for x in authority["account_auths"] if x[0] != foreign_account["name"]]
|
|
4107
|
+
)
|
|
4057
4108
|
except Exception:
|
|
4058
4109
|
raise ValueError("Unknown foreign account or unvalid public key")
|
|
4059
4110
|
|
nectar/block.py
CHANGED
nectar/blockchain.py
CHANGED
|
@@ -1016,12 +1016,12 @@ class Blockchain(object):
|
|
|
1016
1016
|
if self.blockchain.rpc.get_use_appbase():
|
|
1017
1017
|
ret = self.blockchain.rpc.get_account_reputations(
|
|
1018
1018
|
{"account_lower_bound": lastname, "limit": steps}, api="condenser"
|
|
1019
|
-
)
|
|
1019
|
+
)
|
|
1020
1020
|
else:
|
|
1021
1021
|
ret = self.blockchain.rpc.get_account_reputations(lastname, steps, api="condenser")
|
|
1022
1022
|
for account in ret:
|
|
1023
1023
|
if isinstance(account, dict):
|
|
1024
|
-
account_name = account["
|
|
1024
|
+
account_name = account["account"]
|
|
1025
1025
|
else:
|
|
1026
1026
|
account_name = account
|
|
1027
1027
|
if account_name != lastname or skip_first is False:
|
nectar/blockchaininstance.py
CHANGED
|
@@ -247,7 +247,12 @@ class BlockChainInstance(object):
|
|
|
247
247
|
|
|
248
248
|
def is_connected(self):
|
|
249
249
|
"""Returns if rpc is connected"""
|
|
250
|
-
|
|
250
|
+
# Consider the instance connected only if an RPC client exists AND
|
|
251
|
+
# it has an active URL set by rpcconnect(). Previously, this returned
|
|
252
|
+
# True when self.rpc was merely instantiated but without a selected
|
|
253
|
+
# working node (i.e., self.rpc.url was None), which caused downstream
|
|
254
|
+
# RPC calls to raise RPCConnection("RPC is not connected!").
|
|
255
|
+
return self.rpc is not None and bool(getattr(self.rpc, "url", None))
|
|
251
256
|
|
|
252
257
|
def __repr__(self):
|
|
253
258
|
if self.offline:
|
|
@@ -939,6 +944,11 @@ class BlockChainInstance(object):
|
|
|
939
944
|
return False
|
|
940
945
|
return "HIVE_CHAIN_ID" in config
|
|
941
946
|
|
|
947
|
+
@property
|
|
948
|
+
def is_steem(self):
|
|
949
|
+
"""Deprecated compatibility flag; always False in Hive-only nectar."""
|
|
950
|
+
return False
|
|
951
|
+
|
|
942
952
|
def set_default_account(self, account):
|
|
943
953
|
"""
|
|
944
954
|
Set the instance default account.
|