mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-12 07:39:41 +02:00
rpc: Fix for duplicate external signers case
In case of multiple external signers, with some duplicates, de-duplicate them: keep one signer per fingerprint, and keep all non-duplicates as well. Add a new test check.
This commit is contained in:
@@ -72,6 +72,19 @@ class RPCSignerTest(BitcoinTestFramework):
|
||||
)
|
||||
self.clear_mock_result(self.nodes[1])
|
||||
|
||||
# Duplicate fingerprints
|
||||
self.set_mock_result(self.nodes[1],
|
||||
'0 ['
|
||||
'{"fingerprint": "00000001", "type": "trezor", "model": "trezor_t"}, '
|
||||
'{"fingerprint": "00000001", "type": "trezor", "model": "trezor_t"}, '
|
||||
'{"fingerprint": "00000002", "type": "trezor", "model": "trezor_one"}'
|
||||
']')
|
||||
assert_equal(self.nodes[1].enumeratesigners(), {"signers": [
|
||||
{"fingerprint": "00000001", "name": "trezor_t"},
|
||||
{"fingerprint": "00000002", "name": "trezor_one"},
|
||||
]})
|
||||
self.clear_mock_result(self.nodes[1])
|
||||
|
||||
assert_equal({'fingerprint': '00000001', 'name': 'trezor_t'} in self.nodes[1].enumeratesigners()['signers'], True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user