-
Notifications
You must be signed in to change notification settings - Fork 296
Update tx-example.py and blocks-query.py #1844
Conversation
Signed-off-by: Igor Egorov <[email protected]>
Signed-off-by: Igor Egorov <[email protected]>
Signed-off-by: Igor Egorov <[email protected]>
No need to have separate method for signing blocks queries Signed-off-by: Igor Egorov <[email protected]>
Signed-off-by: Igor Egorov <[email protected]>
@@ -211,6 +217,28 @@ def query(self, name, counter=1, creator_account=None, created_time=None, **kwar | |||
internal_query.CopyFrom(message) | |||
return query_wrapper | |||
|
|||
def blocks_query(self, counter=1, creator_account=None, created_time=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be just creator_account=self.creator_account, created_time=self.now()
? Lines 228-231 could be removed after that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, that won't work, since self is not defined at the moment of evaluation.
>>> class A(object):
... def __init__(self):
... self.a = 'abc'
... def x(self, param=self.a):
... print(param)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in A
NameError: name 'self' is not defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python was definitely overrated by me.
Signed-off-by: Igor Egorov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix minor issues
.createdTime(current_time()) \ | ||
.transferAsset("admin@test", "userone@domain", "coin#domain", "Some message", "2.00").build() | ||
tx = iroha.transaction([ | ||
iroha.command('TransferAsset', src_account_id='admin@test', dest_account_id='userone@domain', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied autopep8
Signed-off-by: Igor Egorov <[email protected]>
Signed-off-by: Igor Egorov <[email protected]>
Since those files ( |
Signed-off-by: Igor Egorov [email protected]
Description of the Change
New Iroha lib in Python gets able to query blocks stream.
Examples
tx-example.py
andblocks-query.py
are updated.Benefits
Up to date examples.
Possible Drawbacks
None ?
Usage Examples or Tests