forked from LBRYCommunity/lbry-sdk
Merge pull request #3535 from vertbyqb/hexdata-string
convert hexdata argument to a string before signing in `channel_sign` command
This commit is contained in:
commit
a4dce8cf9f
2 changed files with 3 additions and 1 deletions
|
@ -2914,7 +2914,7 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
wallet, channel_account_id, channel_id, channel_name, for_signing=True
|
wallet, channel_account_id, channel_id, channel_name, for_signing=True
|
||||||
)
|
)
|
||||||
timestamp = str(int(time.time()))
|
timestamp = str(int(time.time()))
|
||||||
signature = signing_channel.sign_data(unhexlify(hexdata), timestamp)
|
signature = signing_channel.sign_data(unhexlify(str(hexdata)), timestamp)
|
||||||
return {
|
return {
|
||||||
'signature': signature,
|
'signature': signature,
|
||||||
'signing_ts': timestamp
|
'signing_ts': timestamp
|
||||||
|
|
|
@ -1233,6 +1233,8 @@ class ChannelCommands(CommandTestCase):
|
||||||
signature2 = await self.out(self.daemon.jsonrpc_channel_sign(channel_id=channel.claim_id, hexdata=data_to_sign))
|
signature2 = await self.out(self.daemon.jsonrpc_channel_sign(channel_id=channel.claim_id, hexdata=data_to_sign))
|
||||||
self.assertTrue(verify(channel, unhexlify(data_to_sign), signature1))
|
self.assertTrue(verify(channel, unhexlify(data_to_sign), signature1))
|
||||||
self.assertTrue(verify(channel, unhexlify(data_to_sign), signature2))
|
self.assertTrue(verify(channel, unhexlify(data_to_sign), signature2))
|
||||||
|
signature3 = await self.out(self.daemon.jsonrpc_channel_sign(channel_id=channel.claim_id, hexdata=99))
|
||||||
|
self.assertTrue(verify(channel, unhexlify('99'), signature3))
|
||||||
|
|
||||||
async def test_channel_export_import_before_sending_channel(self):
|
async def test_channel_export_import_before_sending_channel(self):
|
||||||
# export
|
# export
|
||||||
|
|
Loading…
Reference in a new issue