-
Notifications
You must be signed in to change notification settings - Fork 80
view tag integration idea / untested [credits jberman] #116
Conversation
not tested / not working - just some initial ideas from Jberman implemented. I am assuming that pre hard fork transcations will have the old json structure
monero/transaction/__init__.py
Outdated
vt = binascii.hexlify(vt_full)[0:2] | ||
if vt != on_chain_vt: | ||
continue | ||
else: |
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.
This shouldn't be an else, the rest of the function should remain unchanged :)
(When scanning, doing the rest of this for every output is slow especially scalarmult_B
; view tags just short-circuit so it doesn't have to do the rest of this for ~99.6% of outputs, but it still needs to do it to check for ownership when vt == on_chain_vt
)
if vout["target"]["tagged_key"]: | ||
#post fork transaction | ||
stealth_address = binascii.unhexlify(vout["target"]["tagged_key"]["key"]) | ||
on_chain_vt = binascii.unhexlify(vout["target"]["tagged_key"]["view_tag"]) |
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.
probably need to keep this on_chain_vt
a hex string for the equality check against vt
downstream to work :)
Or alternatively, can keep this as is, and then instead of vt = binascii.hexlify(vt_full)[0:2]
later on, grab just the first byte of vt_full
in binary.. but I'm not sure how to do that in this code. That's probably the ideal approach
monero/transaction/__init__.py
Outdated
) | ||
if payment: | ||
break | ||
outs.append( | ||
Output( | ||
stealth_address=vout["target"]["key"], | ||
stealth_address=stealth_address, |
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.
looks like this is changing the passed in type from a hex string to binary and I would think would cause these tests to fail?
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.
Thanks, good spot! hacky'd a fix to set the original type key for both 👍
No description provided.