Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Witness object not correctly loaded when Account object is created first. #137

Closed
Zapata opened this issue Aug 27, 2018 · 1 comment
Closed
Labels

Comments

@Zapata
Copy link
Member

Zapata commented Aug 27, 2018

There is an inconsistency if Witness object is used after the Account object:

>>> import json
>>> from bitshares.account import Account
>>> from bitshares.witness import Witness
>>> account = Account('zapata42-witness')
>>> witness = Witness('zapata42-witness')
>>> json.dumps(witness)
'{"referrer_rewards_percentage": 0, "membership_expiration_date": "1969-12-31T23:59:59", "registrar": "1.2.987999", "whitelisted_accounts": [], "owner": {"weight_threshold": 1, "account_auths": [], "address_auths": [], "key_auths": [["BTS7BQS6exdxWvB3n4FH9Ks4s8DnekA1ciQgVNGyEHxqCtPNfbii8", 1]]}, "lifetime_referrer": "1.2.987999", "network_fee_percentage": 2000, "name": "zapata42-witness", "owner_special_authority": [0, {}], "blacklisting_accounts": [], "active_special_authority": [0, {}], "whitelisting_accounts": [], "top_n_control_flags": 0, "referrer": "1.2.987999", "cashback_vb": "1.13.18009", "options": {"memo_key": "BTS63isAKsVtjEgWV6994SVWNyeYtQVEX4Vjo9RewDTzJiijtfkNZ", "extensions": [], "voting_account": "1.2.290586", "num_committee": 0, "votes": [], "num_witness": 0}, "id": "1.2.987999", "blacklisted_accounts": [], "statistics": "2.6.987999", "active": {"weight_threshold": 1, "account_auths": [], "address_auths": [], "key_auths": [["BTS63isAKsVtjEgWV6994SVWNyeYtQVEX4Vjo9RewDTzJiijtfkNZ", 1]]}, "lifetime_referrer_fee_percentage": 8000}'

Here the dumped witness is an Account object.

However Witness is working correctly if used first:

>>> from bitshares.witness import Witness
>>> json.dumps(Witness('zapata42-witness'))
'{"vote_id": "1:398", "total_votes": "43551485631072", "signing_key": "BTS6r8oVoPHZ5J8Q4bv5qA9tqa3r3XXhmKZQXGiP5gcsFb7qt64RH", "last_confirmed_block_num": 29975522, "id": "1.6.129", "pay_vb": "1.13.18488", "last_aslot": 30131702, "total_missed": 0, "url": "https://bitsharestalk.org/index.php?topic=26881.0", "witness_account": "1.2.987999"}'

Or if the Account is dumped (forced to load) first:

>>> import json
>>> from bitshares.account import Account
>>> from bitshares.witness import Witness
>>> account = Account('zapata42-witness')
>>> json.dumps(account)
'{"blacklisted_accounts": [], "top_n_control_flags": 0, "owner": {"key_auths": [["BTS7BQS6exdxWvB3n4FH9Ks4s8DnekA1ciQgVNGyEHxqCtPNfbii8", 1]], "account_auths": [], "address_auths": [], "weight_threshold": 1}, "cashback_vb": "1.13.18009", "id": "1.2.987999", "blacklisting_accounts": [], "statistics": "2.6.987999", "whitelisting_accounts": [], "membership_expiration_date": "1969-12-31T23:59:59", "registrar": "1.2.987999", "active": {"key_auths": [["BTS63isAKsVtjEgWV6994SVWNyeYtQVEX4Vjo9RewDTzJiijtfkNZ", 1]], "account_auths": [], "address_auths": [], "weight_threshold": 1}, "network_fee_percentage": 2000, "lifetime_referrer_fee_percentage": 8000, "active_special_authority": [0, {}], "lifetime_referrer": "1.2.987999", "options": {"voting_account": "1.2.290586", "memo_key": "BTS63isAKsVtjEgWV6994SVWNyeYtQVEX4Vjo9RewDTzJiijtfkNZ", "num_committee": 0, "num_witness": 0, "extensions": [], "votes": []}, "owner_special_authority": [0, {}], "referrer_rewards_percentage": 0, "referrer": "1.2.987999", "whitelisted_accounts": [], "name": "zapata42-witness"}'
>>> witness = Witness('zapata42-witness')
>>> json.dumps(witness)
'{"last_aslot": 30131830, "vote_id": "1:398", "pay_vb": "1.13.18488", "id": "1.6.129", "last_confirmed_block_num": 29975649, "total_votes": "43551485631072", "url": "https://bitsharestalk.org/index.php?topic=26881.0", "witness_account": "1.2.987999", "signing_key": "BTS6r8oVoPHZ5J8Q4bv5qA9tqa3r3XXhmKZQXGiP5gcsFb7qt64RH", "total_missed": 0}'

It should be an error somewhere in the cache feature.

Version used:

bitshares              0.1.19
graphenelib            0.6.6
@xeroc xeroc added the bug label Sep 27, 2018
@xeroc
Copy link
Member

xeroc commented Feb 21, 2019

I suppose this can be closed

@xeroc xeroc closed this as completed Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants