steem-python
steem-python copied to clipboard
SignedTransaction needs to take "chain" parameter
Here is a minimal example that demonstrates the issue:
#!/usr/bin/env python3
import steem
from steembase.transactions import SignedTransaction
tx_json = {"operations": [["account_update", {"account": "initminer", "owner": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TST7WsaeWJEyuZDNUjAKGhiz3QiYArAo2iZQ6uXybQwDSLywiWimd", 1]]}, "active": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TST66Df3nRNXZPRwXsSdU8J8wMBaYZQc1FqNi3FWrjsUh3Vc8WqD4", 1]]}, "posting": {"weight_threshold": 1, "account_auths": [], "key_auths": [["TST5XDJPKttDdhXKciVY5WbZEwwwsL3ki74ftJf5U581pzLZzCSkW", 1]]}, "memo_key": "TST7gVFwxitzhAhVsVNMmiUJhcW7d9Xog9s9d2tXNQKQmpNvwqXn1", "json_metadata": ""}]], "ref_block_num": 6, "ref_block_prefix": 429565289, "expiration": "2016-01-01T00:01:18"}
steemd = steem.Steem(nodes=["127.0.0.1:13520"])
signed_tx = SignedTransaction(tx_json)
What needs to happen is the SignedTransaction()
constructor needs to be adapted to take a named parameter called chain
which contains a dictionary of chain settings including prefix, asset names and chain ID. (As a convenience chain
can also be a string, in which case the dictionary is determined by looking it up in known_chains
.) Then these are passed to the appropriate sub-objects.