mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 11:21:11 +00:00
test_msg_getaddress_show test now supports multisig
This commit is contained in:
parent
58f5644402
commit
c0d0b191d6
@ -1,6 +1,8 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import common
|
import common
|
||||||
import trezorlib.ckd_public as bip32
|
import trezorlib.ckd_public as bip32
|
||||||
|
import trezorlib.types_pb2 as proto_types
|
||||||
|
import binascii
|
||||||
|
|
||||||
class TestMsgGetaddress(common.TrezorTest):
|
class TestMsgGetaddress(common.TrezorTest):
|
||||||
|
|
||||||
@ -10,5 +12,20 @@ class TestMsgGetaddress(common.TrezorTest):
|
|||||||
self.assertEqual(self.client.get_address('Bitcoin', [2], show_display=True), '15AeAhtNJNKyowK8qPHwgpXkhsokzLtUpG')
|
self.assertEqual(self.client.get_address('Bitcoin', [2], show_display=True), '15AeAhtNJNKyowK8qPHwgpXkhsokzLtUpG')
|
||||||
self.assertEqual(self.client.get_address('Bitcoin', [3], show_display=True), '1CmzyJp9w3NafXMSEFH4SLYUPAVCSUrrJ5')
|
self.assertEqual(self.client.get_address('Bitcoin', [3], show_display=True), '1CmzyJp9w3NafXMSEFH4SLYUPAVCSUrrJ5')
|
||||||
|
|
||||||
|
def test_show_multisig(self):
|
||||||
|
self.setup_mnemonic_nopin_nopassphrase()
|
||||||
|
|
||||||
|
multisig = proto_types.MultisigRedeemScriptType(
|
||||||
|
pubkeys=[binascii.unhexlify('0338d78612e990f2eea0c426b5e48a8db70b9d7ed66282b3b26511e0b1c75515a6'),
|
||||||
|
binascii.unhexlify('038caebd6f753bbbd2bb1f3346a43cd32140648583673a31d62f2dfb56ad0ab9e3'),
|
||||||
|
binascii.unhexlify('03477b9f0f34ae85434ce795f0c5e1e90c9420e5b5fad084d7cce9a487b94a7902')],
|
||||||
|
signatures=['', '', ''],
|
||||||
|
m=2,
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(self.client.get_address('Bitcoin', [1], show_display=True, multisig=multisig), '3E7GDtuHqnqPmDgwH59pVC7AvySiSkbibz')
|
||||||
|
self.assertEqual(self.client.get_address('Bitcoin', [2], show_display=True, multisig=multisig), '3E7GDtuHqnqPmDgwH59pVC7AvySiSkbibz')
|
||||||
|
self.assertEqual(self.client.get_address('Bitcoin', [3], show_display=True, multisig=multisig), '3E7GDtuHqnqPmDgwH59pVC7AvySiSkbibz')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@ -388,9 +388,12 @@ class ProtocolMixin(object):
|
|||||||
|
|
||||||
@field('address')
|
@field('address')
|
||||||
@expect(proto.Address)
|
@expect(proto.Address)
|
||||||
def get_address(self, coin_name, n, show_display=False):
|
def get_address(self, coin_name, n, show_display=False, multisig=None):
|
||||||
n = self._convert_prime(n)
|
n = self._convert_prime(n)
|
||||||
return self.call(proto.GetAddress(address_n=n, coin_name=coin_name, show_display=show_display))
|
if multisig:
|
||||||
|
return self.call(proto.GetAddress(address_n=n, coin_name=coin_name, show_display=show_display, multisig=multisig))
|
||||||
|
else:
|
||||||
|
return self.call(proto.GetAddress(address_n=n, coin_name=coin_name, show_display=show_display))
|
||||||
|
|
||||||
@field('entropy')
|
@field('entropy')
|
||||||
@expect(proto.Entropy)
|
@expect(proto.Entropy)
|
||||||
|
Loading…
Reference in New Issue
Block a user