forked from LBRYCommunity/lbry-sdk
Merge pull request #514 from lbryio/fix-compare-outpoint
Add string comparison to ClaimOutpoint
This commit is contained in:
commit
74cf14df48
2 changed files with 3 additions and 1 deletions
|
@ -19,7 +19,7 @@ at anytime.
|
||||||
*
|
*
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
*
|
* Added string comparison to ClaimOutpoint (needed to look things up by outpoint)
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,8 @@ class ClaimOutpoint(dict):
|
||||||
return (self['txid'], self['nout']) == (compare['txid'], compare['nOut'])
|
return (self['txid'], self['nout']) == (compare['txid'], compare['nOut'])
|
||||||
elif 'nout' in compare:
|
elif 'nout' in compare:
|
||||||
return (self['txid'], self['nout']) == (compare['txid'], compare['nout'])
|
return (self['txid'], self['nout']) == (compare['txid'], compare['nout'])
|
||||||
|
elif type(compare) in [str, unicode]:
|
||||||
|
return compare == self.__repr__()
|
||||||
else:
|
else:
|
||||||
raise TypeError('cannot compare {}'.format(type(compare)))
|
raise TypeError('cannot compare {}'.format(type(compare)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue