import pytest, time, base64, shutil


msc0 = ('msc0', 'XTN', 14, None,
        ['[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<0;1>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<2;3>/*'],
        'or_d(pk(@0/<0;1>/*),and_v(v:pkh(@0/<2;3>/*),older(5)))',
        False, True, False, False)
psbt0 = 'cHNidP8BAIkCAAAAAZUEvRkqYPrqNKdvyfg7NQopNrWECJgMNqjca1IcEIVTAQAAAAD9////ApQuGh4BAAAAIgAgGjlJEPeLTybA3gHmfxuqEd7X1+PQZN31PiCG5GIfo5QA4fUFAAAAACIAIBO/Xj1D55iB+2Vdhp0jRls7TMrYi3kDWrSGbF07PwfHAAAAAAABAH0CAAAAAXB5YpRHvulXzMx3Gb+uCMYBCG3m4huSm9AAc8OoWQ70AAAAAAD9////AgzV9QUAAAAAFgAUOG3K9ZXBYY3cvxmqFWXyHewk/K0AERAkAQAAACIAIGdWKDqhxwBgKRV7QF+tYv516km5iOKZw8CktnFKO6VmZQAAAAEBKwARECQBAAAAIgAgZ1YoOqHHAGApFXtAX61i/nXqSbmI4pnDwKS2cUo7pWYBBUEhAv4uHbVQEQkVrUThtBx6BnGlZJcyVHMKOYaJoBpEjQJyrHNkdqkUM+9pq+yldgqOn/1x/0rqPEMVp86IrVWyaCIGAv4uHbVQEQkVrUThtBx6BnGlZJcyVHMKOYaJoBpEjQJyGA8FaUNUAACAAQAAgAAAAIAAAAAAAAAAACIGA2e65FIqxSTkQqvwsotxrrWTyaY1q47lIMO19ZaZ8D9zGA8FaUNUAACAAQAAgAAAAIACAAAAAAAAAAABAUEhAv4IiIHn01IKyw4lEaIxhArVyFqGABpomkhcTjULKKv7rHNkdqkUqOoqpzlXZR4XRJ8ozXFV3QTy8bCIrVWyaCICAt97v3uk5Jw1GcvpwazScC2ZRQPNOI7QqwAO7GYhQFJ7GA8FaUNUAACAAQAAgAAAAIADAAAAAAAAACICAv4IiIHn01IKyw4lEaIxhArVyFqGABpomkhcTjULKKv7GA8FaUNUAACAAQAAgAAAAIABAAAAAAAAAAABAUEhA4/rg1i66LDEfY+O55hN2NoI/I/DlwP21VPYbrGIoWiMrHNkdqkUxeG8e0VP5VXSyTnAGNyZJdSljFSIrVWyaCICAxtQTXbpjMrxg7OlwJvsVHMO0LcUtasy4ofc4KsG7lMaGA8FaUNUAACAAQAAgAAAAIACAAAAAQAAACICA4/rg1i66LDEfY+O55hN2NoI/I/DlwP21VPYbrGIoWiMGA8FaUNUAACAAQAAgAAAAIAAAAAAAQAAAAA='

msc1 = ('msc1', 'XTN', 14, None,
        ['[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<2147483646;2147483647>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<100;101>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<26;27>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<4;5>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<20;21>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<104;105>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<22;23>/*'],
        'or_i(and_v(v:pkh(@0/<2147483646;2147483647>/*),older(10)),or_d(multi(3,@0/<100;101>/*,@0/<26;27>/*,@0/<4;5>/*),and_v(v:thresh(2,pkh(@0/<20;21>/*),a:pkh(@0/<104;105>/*),a:pkh(@0/<22;23>/*)),older(5))))',
        False, True, False, False)
psbt1 = 'cHNidP8BAIkCAAAAAf8rpSsYKlmRpN0+n/Y3YLK4TDpwikDdYt7LK2w++qCwAAAAAAD9////AvwtGh4BAAAAIgAgG5mXChevIiZ3YDCLC1aKrdXKbwjnl74wXzikDpWCAlAA4fUFAAAAACIAIAQ9W7Qkohq75Xmm8RV8+5uUzWPkxBfz8EPjJf2868i7AAAAAAABAH0CAAAAAWBaLXl45cdMWgJzmOQO59k4Csj5WMbJPZhDnO21cIeeAAAAAAD9////AgARECQBAAAAIgAglw2gjUfiXui+GqtArJUiov5l1BgN3e8Hr1v+nFo8dK8M1fUFAAAAABYAFEQab/35TIyAyQcXU+hOF7WAI1GBZQAAAAEBKwARECQBAAAAIgAglw2gjUfiXui+GqtArJUiov5l1BgN3e8Hr1v+nFo8dK8BBd9jdqkUmwe9Q6Qh1E309/0qw/NUgIk+cH2IrVqyZ1MhAxEQqTu0DFvpeBQizIB02+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FaUNUAACAAQAAgAAAAID+//9/AQAAACICA0BQuT0XvgLjmlJF5paqn1mCTwXurzKHaNayYASBRFWIGA8FaUNUAACAAQAAgAAAAIBoAAAAAQAAACICA081EpHvDZZMlTURQBhP850RXFk5agfDpbXpzuXMQeqyGA8FaUNUAACAAQAAgAAAAIAaAAAAAQAAACICA12o/lWYfTfub2yc44Jv4boKBSE+ckY2POIokTsZU6HjGA8FaUNUAACAAQAAgAAAAIAWAAAAAQAAACICA/iF7CoWlyWJiCYe/KymfcmZiKN8LRVzwXIx8I1Hs6xBGA8FaUNUAACAAQAAgAAAAIBkAAAAAQAAAAA='

msc2 = ('msc2', 'XTN', 35,
        'tpubD6NzVbkrYhZ4WhUnV3cPSoRWGf9AUdG2dvNpsXPiYzuTnxzAxemnbajrATDBWhaAVreZSzoGSe3YbbkY2K267tK3TrRmNiLH2pRBpo8yaWm/<2;3>/*',
        ['[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<0;1>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<2;3>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<2147483646;2147483647>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<100;101>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<26;27>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<4;5>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<20;21>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<104;105>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<22;23>/*'],
        '{or_d(pk(@0/<0;1>/*),and_v(v:pkh(@0/<2;3>/*),older(5))),or_i(and_v(v:pkh(@0/<2147483646;2147483647>/*),older(10)),or_d(multi_a(3,@0/<100;101>/*,@0/<26;27>/*,@0/<4;5>/*),and_v(v:thresh(2,pkh(@0/<20;21>/*),a:pkh(@0/<104;105>/*),a:pkh(@0/<22;23>/*)),older(5))))}',
        False, False, False, True)
psbt2 = '[encoded data, 5308 characters]'

msc3 = ('msc3', 'XTN', 35,
        '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<66;67>/*',
        ['[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<0;1>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<2;3>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<2147483646;2147483647>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<100;101>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<26;27>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<4;5>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<20;21>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<104;105>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<22;23>/*'],
        '{or_d(pk(@0/<0;1>/*),and_v(v:pkh(@0/<2;3>/*),older(5))),or_i(and_v(v:pkh(@0/<2147483646;2147483647>/*),older(10)),or_d(multi_a(3,@0/<100;101>/*,@0/<26;27>/*,@0/<4;5>/*),and_v(v:thresh(2,pkh(@0/<20;21>/*),a:pkh(@0/<104;105>/*),a:pkh(@0/<22;23>/*)),older(5))))}',
        False, False, False, True)
psbt3 = '[encoded data, 5356 characters]'

msc4 = ('msc4', 'XTN', 35,
        'unspend(eaa76f06a330102de2653adda09522b704868d1e5ec63b6eadf35906d5ef47a8)/<2;3>/*',
        ['[5baa3998/44h/1h/0h]tpubDC8cZY4a6nmoa9DDumkEayC7Sn6sMXjwTPYbYb91KH5GoT8G9nHFpLSaWe7xcHXARepk3q5h1vLsJgpeSzcggFVdhGpKkqK1Ujv8KFBbv9K/<0;1>/*',
         '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<4;5>/*',
         '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<6;7>/*'],
        '{or_d(pk(@0/<0;1>/*),and_v(v:pkh(@1/<4;5>/*),older(5))),pk(@1/<6;7>/*)}',
        False, False, False, True)
psbt4 = 'cHNidP8BAIkCAAAAAaI+zXUijROvx3BUydOPucckqyefFc+e5mu5PJcslkr2AQAAAAD9////AuQjGh4BAAAAIlEgO4k51uF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Zin1OFUOXaZ6BkOQG++wX4eKvtJUbRWC7HrNkgxeVxwagMS/O0xYoZLUPTvw8FaUNWAACAAQAAgAAAAIAFAAAAAAAAAAA='

msc5 = ('msc5', 'XTN', 35,
        'tpubD6NzVbkrYhZ4WeQCEoPi88B5FpWsnGfBmm76EUtexSg17KaNVAPeGwYWJ4aD1YDrFZ9P6pNAZEpWZHtBczPryBDKXQnhn1VPWAiSE5AzgSc/<0;1>/*',
        ['[c65b017a/44h/1h/0h]tpubDD1b2M82BJ2PWbC2KyUaTEgFiUsYrd9QU8dMTbcXTRZA9rBMnbMQLB1ZU1icGSBZwd8KNm7oD3GceMMW7y1t27xmVLUaSChGxtyM3NoxLi2/<0;1>/*',
         '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<0;1>/*',
         '[ff12824b/44h/1h/0h]tpubDDcx2UWrF6LRNdGGYoLFkfZZuahG63yBN4BuNiuSEfFfhCAGJU81QKw1zbQVM8sn1NomMa1LSZLh7mzK8gxfpuRHbXhykg4wXK6dg56pnti/<0;1>/*',
         '[b69b3715/44h/1h/0h]tpubDDRVW8LtH1wB2JrSEGf8eixM1HrjZVJCx6NNbxNpyZ775CGFMVLQ3dppmK7b75Ze3uZeAKiV1RDWotMXU2ns2mcUEmdZosaSfCg6QwJsRnH/<0;1>/*'],
        '{pk(@0/<0;1>/*),or_d(multi_a(2,@1/<0;1>/*,@2/<0;1>/*),and_v(v:pkh(@3/<0;1>/*),older(5)))}',
        False, False, False, True)
psbt5 = 'cHNidP8BAIkCAAAAASVwoGngdxBqa9fz4Qd+GIrYjdWZwg9kGXUjaAI1VUvHAQAAAAD9////AuQjGh4BAAAAIlEgUoaPhtWF8tZQ7NustBoMcSh1Z6ddflry4gNYs+ZQ4zwA4fUFAAAAACJRIG1HwYFqkl4OkNX7ZVk6aX6Sfw15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QKOrNs4wjrwfBciK/GiGA8FaUNUAACAAAAAgAAAAIAAAAAAAQAAACICA1JLXehw3jTSBY949/rYqUbK0RH0CzOEDBRnJ3G0X7bRGCLaA0MsAACAAQAAgAAAAIAAAAAAAQAAAAA='

msc7 = ('msc7',
        'XTN',
        26,
        None,
        ['[0f056943/84h/0h/0h]tpubDCx8y86cKonoPyTtj3f9NZLpBYoBNkbAzUdafMHhggjxkhF8Dny2aekWfDafywEMZEQaQjkK9Gxn7aN7usLRUQdYbvDgcnmYRf72khPEouL/<0;1>/*',
         '[15ace8ea/44h/1h/0h]tpubDDu2UQkKM2qC4PbeeF6QLjpa2zLhzqNTEMCvR4tcvsNLDSFU71LhE2iuu4n4r6EpcMiRqWefkPFvqXbpEPrLbu845kLzvomc9TLcU6MFRnz/<0;1>/*',
         '[f6d171f3/44h/1h/0h]tpubDCHEhsb2A6wPTSMfehSyAz1A2e2KLTRsxP6esPFcWaDHMB34KypYx9ghUfjP4yvEHwpQVhq3rMPk5NNpF7f9TXLBMYjHsbi97oY2MKwpdqr/<0;1>/*'],
        'or_d(pk(@0/<0;1>/*),and_v(v:multi(2,@1/<0;1>/*,@2/<0;1>/*),after(105)))',
        True,
        True,
        False,
        False)
psbt7 = 'cHNidP8BAHMCAAAAAee9+U9VlOKIxxnS8lU1B2UAxG4rBr7b19E1x3+rdFyuAQAAAAD9////AgDh9QUAAAAAF6kUuKH4qKblAE+rGF/umyLErOfKj82HIB8aHgEAAAAXqRQMj2DqZNf+8oPXrt6ESCCkV7vUn4cAAAAAAAEAcwIAAAABrDsI989CKpOYTdwsKuoLwj2TWtZCKP8O7cBkGsZDMMUAAAAAAP3///8C1NX1BQAAAAAXqRQ/2fGSLgsGlZ8IOlwomAfdAFNiIYcAERAkAQAAABepFDqmHpfbOn965Rg2xIIyaA2+KHITh2UAAAABASAAERAkAQAAABepFDqmHpfbOn965Rg2xIIyaA2+KHIThwEEIgAgKGcMdKaBlKaEzA74l8+lK0tNJTNbGTOCxCjnU8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d9BK59yngE2g4Y9tFx8ywAAIABAACAAAAAgAAAAAABAAAAIgIC9qQrf7kawp6+Tzo/S8+/mgkBAo6s2zjCOvB8FyIr8aIYDwVpQ1QAAIAAAACAAAAAgAAAAAABAAAAIgIDDQt6gVVSrSzNggc3rBNVSWs0kj01zqAgRJeYzzGWZm8YFazo6iwAAIABAACAAAAAgAAAAAABAAAAAA=='

msc8 = ('msc8',
        'XTN',
        14,
        None,
        ['[01d03393/44h/1h/0h]tpubDDAF9jGCaBw7dJ6DLnPH2mzq1RJcDuf11hQYv68yB9h54mJ3SH9HqcPPewekxeYRr5dYCUVyjwyBCCuDQjooFjJAJkcmwBPKJT5GB9dYhX4/<0;1>/*',
         '[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<0;1>/*',
         '[36007fa0/44h/1h/0h]tpubDDH4Qq4JEWcqGZ6quCxMsq5qJrbQkSEx4bRoTn7XUt3kgnwuSrvCA1gehroD6T2HWHBcV7XEDDYxVDkpV342htHxRJ4PQc7RcHxdwkrbCy8/<0;1>/*',
         '[2ef62e5b/44h/1h/0h]tpubDCRSQVsy1ueB34k4G3GyWgFGKfRLNksBeGgEwUZiZYGhvnVUsP4CWHPeyy8ryGkjtV1YjLBMWTbRnGaEqEETnJXj7XP8Y2pYa2WY2mFT9bn/<0;1>/*',
         '[f8dc2d63/44h/1h/0h]tpubDDrqVehtKQ53gHAwXhxo3M1ZwwEXhraA5xdPR5JWDviFLnuPECUttAWYpFKF9UTGqg6rzXKfujyrUyUuVXVdk6gxt2tZaz8qoMVTHA26e4o/<0;1>/*',
         '[185ec28a/44h/1h/0h]tpubDCGy13DqjMd4gTWhmobGtpP3TKzHySci2CQBBU2ypDKLuGUyNLqctYeypXWS56EVizni2FqP9YD8tsXDWzs76YW7epABV9ad3dKU52GAAbz/<0;1>/*',
         '[d8a8170c/44h/1h/0h]tpubDDcSLWkXynTZ2h4dGgybHmE9pPHkURy1QbDQBES6v5vjRRgrNU5vD9DzpjeiQewpPsAz6ZptPBpa44qw5Aczx1CA8zyGrHVCbnXeyHeqbvJ/<0;1>/*'],
        'or_i(and_v(v:pkh(@0/<0;1>/*),older(10)),or_d(multi(3,@1/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*),and_v(v:thresh(2,pkh(@4/<0;1>/*),a:pkh(@5/<0;1>/*),a:pkh(@6/<0;1>/*)),older(5))))',
        False,
        True,
        False,
        False)
psbt8 = 'cHNidP8BAIkCAAAAASowxiR6OT8AQ792LwaK3Wy82QZY0Oea3EdMrL6oeuCxAQAAAAD9////AgAwGh4BAAAAIgAgYgQ1bQQS4Jjp6L8MssoMAouQwUWBt2kYJgxkRuIhpaPYzPUFAAAAACIAIIzCCM7fS9Y78z4OA3ViRp7MFBy/GI3GKiFWjjXVFwQSAAAAAAABAH0CAAAAAXAJLklWKtNiFIjh1OxkxpEkjfAbn+t9cTEKJXaEdPgZAAAAAAD9////AgzV9QUAAAAAFgAUXxQzDV1zCEDHOtlCh9EFCISDYTwAERAkAQAAACIAICEJ5gt9CGwcUi57nJYc4tbLgwHjBUS39MNclDlv5QosZQAAAAEBKwARECQBAAAAIgAgIQnmC30IbBxSLnuclhzi1suDAeMFRLf0w1yUOW/lCiwBBd9jdqkUUwX1AvCnz7Z+ECfl3qmiyh67WoaIrVqyZ1MhAv4uHbVQEQkVrUThtBx6BnGlZJcyVHMKOYaJoBpEjQJyIQLCCKIiCcIdXo2RrWw+m/B80sNhGijKVkgDdPwEQX/dDyECRYgqoVJxobeLD+uFogX3iG/H0us05fLpDDTRzmxMDBpTrnNkdqkUOfbi0FdpVKG2j9K/P2Xh4+JMo/WIrGt2qRQXku+UyCga2S2+pM1RsYDnxHcsWoisbJNrdqkUfbUVSftey8pVdNDuxUIiG3ApLs6IrGyTUohVsmhoIgYCRYgqoVJxobeLD+uFogX3iG/H0us05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A5WlP7dpPUXQO097zWHWiY57BEnRzGUo3NAMiVqTJeNuGNioFwwsAACAAQAAgAAAAIAAAAAAAQAAAAA='

msc9 = ('msc9',
        'XTN',
        35,
        'tpubD6NzVbkrYhZ4WMCcYXEgDrM1AFATSGmrFyMnA2Dgx1Y551VueaE3iemHhQBxhKWjepG76Cy5QmXv8z4KwN6ARTnZ5hVuShfxL129NVGXZuE/<0;1>/*',
        ['[0f056943/48h/1h/0h/3h]tpubDF2rnouQaaYrY6CUWTapYkeFEs3h3qrzL4M52ZGoPeU9dkarJMtrw6VF1zJRGuGuAFxYS3kXtavfAwQPTQkU5dyNYpbgxcpftrR8H3U85Ez/<0;1>/*',
         '[73c99def/44h/1h/0h]tpubDDU2nuesHbwsZdZcjSXaLSYLpMmkRq6DSxVsGyyM3Zftojb8xEr7RGcjUMLL84YYzkvrMD6SiRBJgo2BXfXsYVAve667Hu1S3noWNDjA342/<0;1>/*',
         '[843a20d6/44h/1h/0h]tpubDDgVgV5xoaEr2Qn4SACCtG8wjwHU5mdMkAkr5xhqRkn51cNmmQiDSDCP9wzXm2cKKJ9enoqQ3wrZ2WEoS1Lcs9MVW3kRh8MvBG7WXe2pY2U/<0;1>/*',
         '[327c93bb/44h/1h/0h]tpubDD61Z1UQmq5uzfDY6rZHHatCsVGjL5fEmgfq6weAeNSt1o1nz5FguJM8RgfWRRSiTQVknLJqTqpCcYg918bPtF9HcntvUtPz1h1xd9azxZs/<0;1>/*',
         '[110d8beb/44h/1h/0h]tpubDDgM8tY3G7wByVp3Gjk6KCnF9qD5mFRhUyzRXLaKyuhAGFm1961dHG5NKNGDZuPwJyxkbE8TrbVXDcArx6UwHr61LC95u1RXjXckBD3a8h4/<0;1>/*',
         '[f34034e3/44h/1h/0h]tpubDC9vBBKf193c5NGz2JgW15NkaahrdAbhfKdTKse4K1SRGpsoWCr4BVDVmTq7aZBzcLLye5EbSgq8FbVVKjCjkoTC1Yj3x9fmmtvXQ5xfFqZ/<0;1>/*',
         '[0f056943/86h/1h/1000h]tpubDCeEX49avtjHpPSsvyzvtLw3XdPLZD1FKwXa6oRDfWzV3tQFgA8qAzS1SLRFZtyEjkedCHbEx82ABzoqUH97hkFFN4UY9ob38X9XoAz5MD5/<0;1>/*'],
        '{{sortedmulti_a(5,@0/<0;1>/*,@1/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*,@4/<0;1>/*),{sortedmulti_a(5,@0/<0;1>/*,@1/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*,@5/<0;1>/*),sortedmulti_a(5,@0/<0;1>/*,@1/<0;1>/*,@2/<0;1>/*,@4/<0;1>/*,@5/<0;1>/*)}},{sortedmulti_a(5,@0/<0;1>/*,@1/<0;1>/*,@3/<0;1>/*,@4/<0;1>/*,@5/<0;1>/*),{sortedmulti_a(5,@0/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*,@4/<0;1>/*,@5/<0;1>/*),{sortedmulti_a(5,@1/<0;1>/*,@2/<0;1>/*,@3/<0;1>/*,@4/<0;1>/*,@5/<0;1>/*),pk(@6/<0;1>/*)}}}}',
        False,
        False,
        False,
        True)
psbt9 = '[encoded data, 11880 characters]'

msc10 = ('msc10',
         'XTN',
         35,
         '[8eca7947/44h/1h/0h]tpubDDMb4yomGjaFLfw7H5Vf5hg9NX6gYPbufimrPPJiujBRkkTAM6KLjVapsgg4jiZWFpUESFfnum5uqHW1LoHrwvvhVKGDJyZAxmdWfkLdZzg/<0;1>/*',
         ['[0f056943/86h/0h/100h]tpubDCrr3F1M4TwdzHNLh6bKhxKAxY56MSdF65ziwC5uni3ozDUfsYVA2GDGSSwrAKdmgZeZBvBFYsb3pwC7baN7DY7y6QSNka93itxZqSUfED9/<0;1>/*',
          '[9ad7aaf5/44h/1h/0h]tpubDCbQqRCKRkhmsVuNNFtkMW2k5w8MoWfWcZdSNEgyrSLFf3X9KL3F5N2DkVU7YPEaZ7mHUngHFkmJTEhz7BS4ixXsav68FMXWfXq4btqHqVo/<0;1>/*',
          '[7d6611a0/44h/1h/0h]tpubDCRFv9sR4cmGD59CgjYWgqXZwCwH8ce7UmpTc5cihMyb5NGHhGQta5EPAcuQjbsBH4qmkSicTL1qRzzycrdEbEP2bMwCPcwviGaPE1AdPgN/<0;1>/*',
          '[948dc473/44h/1h/0h]tpubDCLRovrtFZ99FW6PqAsHpYThgUFVhDohRgq4dKciFDTTkVjaDttDUfjDKEFt9n8vWoDYgoTqaZJhyLsFiSf2SH7Ns4uEY3SoLjXE56AP9me/<0;1>/*',
          '[24e307f7/44h/1h/0h]tpubDCv3JZrbaza97d68DsGD864qwfosuLNm9amJ3jNKqjEcfgKN7Xytnfkgmm9JDJuVwVyPyKMyM853h2M1E8QyY8FPuGzbgHwGZKFocHxqxwZ/<0;1>/*',
          '[fd503bd6/44h/1h/0h]tpubDDLCDAXYMkfBM9dK3SyF5rVCBnxpxS3uJj22Qk29JYVRxcywEdLyADp6gtjYFC93pCXUS76D1pKHutDmEktm8TXGD3A8q4XsebnMukXJnWw/<0;1>/*',
          '[b7076d9e/44h/1h/0h]tpubDCvBpiqp4FjBtG5BPSyJzDRf44QDuGzPVrbpjH7yp2TnW5r1noong1pDv826hvD5nZitq7PXn5mjkiwgBUPuynNvZqkf28QY1ZL8F9ms8tj/<0;1>/*',
          '[2366936b/44h/1h/0h]tpubDCEZPU51TzpzMjEYm41qDZLwGCtmhtEbamgAvLyUHK99vpxExCF1up8c8739HYJXHZnybcvsjT5XNLH47pfAgbscDq21zUjxPUwS7BbZgm1/<0;1>/*'],
         '{{{pk(@0/<0;1>/*),pk(@1/<0;1>/*)},{pk(@2/<0;1>/*),pk(@3/<0;1>/*)}},{{pk(@4/<0;1>/*),pk(@5/<0;1>/*)},{pk(@6/<0;1>/*),pk(@7/<0;1>/*)}}}',
         False,
         False,
         False,
         True)
psbt10 = '[encoded data, 6216 characters]'

msc11 = ('msc11',
         'XTN',
         14,
         None,
         ['[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<0;1>/*',
          '[0f056943/84h/1h/9h]tpubDC7jGaaSE66QBAcX8TUD3JKWari1zmGH4gNyKZcrfq6NwCofKujNF2kyeVXgKshotxw5Yib8UxLrmmCmWd8NVPVTAL8rGfMdc7TsAKqsy6y/<0;1>/*'],
         'or_d(pk(@0/<0;1>/*),and_v(v:pkh(@1/<0;1>/*),older(5)))',
         False,
         True,
         False,
         False)
psbt11 = 'cHNidP8BAIkCAAAAAeajJP7NnniNTc0ijFoXLSLtb7PO2fnQ8jbl8C+DVxdsAQAAAAD9////ApQuGh4BAAAAIgAgYQyLpJkO9kBVeWXDYdxaXSvS7QQnOoi4FD+PamMH/X4A4fUFAAAAACIAIBWoIlvyWbWTvKnqtnPqHQPvHp0zOuzSxZykLf6o39JAAAAAAAABAH0CAAAAAQ8q09oG5iqNoaLh+d+wnJx8ZmSV6stHDXD168XsKpa1AAAAAAD9////AgzV9QUAAAAAFgAUK/ucYCV98CDUd+ad9FhOyNOVF3QAERAkAQAAACIAILDk63Iobkx0I4JV4PBNdXfwdQYWXsogF9IUgV6VAbSlYgAAAAEBKwARECQBAAAAIgAgsOTrcihuTHQjglXg8E11d/B1BhZeyiAX0hSBXpUBtKUBBUEhAv4uHbVQEQkVrUThtBx6BnGlZJcyVHMKOYaJoBpEjQJyrHNkdqkUHjL11qZ7EjPWsWmzAEK9NtBwWT6IrVWyaCIGAtH+84GMHyKHtjE4maikoSEkG/eMCQak6oo4yNI+EbPUGA8FaUNUAACAAQAAgAkAAIAAAAAAAAAAACIGAv4uHbVQEQkVrUThtBx6BnGlZJcyVHMKOYaJoBpEjQJyGA8FaUNUAACAAQAAgAAAAIAAAAAAAAAAAAABAUEhAv4IiIHn01IKyw4lEaIxhArVyFqGABpomkhcTjULKKv7rHNkdqkUd5gurNTUtMrZ7ZiTL4iKDnmlpeyIrVWyaCICAkSD3BVCWHBK+5zkCAFC8SHxd5FDK8kqVUabscA1eUONGA8FaUNUAACAAQAAgAkAAIABAAAAAAAAACICAv4IiIHn01IKyw4lEaIxhArVyFqGABpomkhcTjULKKv7GA8FaUNUAACAAQAAgAAAAIABAAAAAAAAAAABAUEhA4/rg1i66LDEfY+O55hN2NoI/I/DlwP21VPYbrGIoWiMrHNkdqkUSB+Xtanv3jBJzKRXZWA12VyS99KIrVWyaCICA0w19Yw7qJXx92jmtN1wbu7fMoSAhE84tUWxTQnpFIGlGA8FaUNUAACAAQAAgAkAAIAAAAAAAQAAACICA4/rg1i66LDEfY+O55hN2NoI/I/DlwP21VPYbrGIoWiMGA8FaUNUAACAAQAAgAAAAIAAAAAAAQAAAAA='

msc12 = ('msc12',
         'XTN',
         35,
         'tpubD6NzVbkrYhZ4WMCcYXEgDrM1AFATSGmrFyMnA2Dgx1Y551VueaE3iemHhQBxhKWjepG76Cy5QmXv8z4KwN6ARTnZ5hVuShfxL129NVGXZuE/<0;1>/*',
         ['[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<0;1>/*',
          '[c6cf0772/44h/1h/0h]tpubDDpU5jGokiDTkDwh9buZtwHZtzFdt1ieJUo9wTZJbQjKPoDqwkbRbgLAjcudTFckERECg62Po3TpYaJEDo2rKGGHHHNLNATx1rVoXkjp8Af/<0;1>/*',
          '[4632a5b7/44h/1h/0h]tpubDCd5ZhLsPEtgobKPyu6UCi4fZTN1GW9Cv8vPyYV7D9PB7EQpUG72yF42uYPE2gYKs4Y7GLSCcsibf8h4TLEyg6MLoKLgH6yNVEWAHMZ8Guh/<0;1>/*'],
         'thresh(3,c:pk_k(@0/<0;1>/*),sc:pk_k(@1/<0;1>/*),sc:pk_k(@2/<0;1>/*),sdv:older(5))',
         False,
         False,
         False,
         True)
psbt12 = 'cHNidP8BAIkCAAAAAWG7v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A9J5IIxhhz9Fcv2htiDxdGMqW3LAAAgAEAAIAAAACAAQAAAAAAAAAhB06AiL5gb7i9vvIVUKbevAtS6bE6BFoWyLToHfxsZDNoDQB8Rh5dAQAAAAAAAAAA'

msc14 = ('msc14',
         'XTN',
         14,
         None,
         ['[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<0;1>/*',
          '[868f806d/44h/1h/0h]tpubDDg3avkJTE6FpMMMcZW4diGGvPv4UdnkRCsHiyuwkuQQx59CRErNoju5veGZJtj4n78cFRQsCexWNQg1xdxapsfGUU58uHDo9b1Mk81PNEq/<0;1>/*',
          '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<2;3>/*',
          '[868f806d/44h/1h/0h]tpubDDg3avkJTE6FpMMMcZW4diGGvPv4UdnkRCsHiyuwkuQQx59CRErNoju5veGZJtj4n78cFRQsCexWNQg1xdxapsfGUU58uHDo9b1Mk81PNEq/<2;3>/*',
          '[8ee3999f/44h/1h/0h]tpubDCyWeEF2pHfsQQPMXp6dVKAVBHpmDKEpMRGUZDKocwE7Ts8HvvrxmEJwdRd9ctDc8ikL7KHRCywbLbkQmkpTS6xZNj5SKSmTE9SyNWSx7sA/<0;1>/*'],
         'or_d(multi(2,@0/<0;1>/*,@1/<0;1>/*),and_v(v:thresh(2,pkh(@0/<2;3>/*),a:pkh(@1/<2;3>/*),a:pkh(@2/<0;1>/*)),older(10)))',
         False,
         True,
         False,
         False)
psbt14 = '[encoded data, 5024 characters]'

msc15 = ('msc15',
         'XTN',
         35,
         'tpubD6NzVbkrYhZ4WbzhCs1gLUM8s8LAwTh68xVh1a3nRQyA3tbAJFSE2FEaH2CEGJTKmzcBagpyG35Kjv3UGpTEWbc7qSCX6mswrLQVVPgXECd/<0;1>/*',
         ['[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<2;3>/*',
          '[607d04ba/44h/1h/0h]tpubDCpjTp9e7txGnMp2jmNGDjtyvBgznTFnD51TxNW1uvpZQS7HDKQKhkYAHcZA9jBRcXY6S4pD6xkJmD7JbBfdzZptRmgwfyj8vKBrkf8F4bA/<2;3>/*',
          '[aa29a974/44h/1h/0h]tpubDDHGzw6SUa25Wx9SJohiSA319YRVakSqaXngLbUnnmVUxses7T9fiLp2bpcAT3gJMFs7aYvbfyREYv21oiXXNMNVnNjw9ZkohPgBXe1NRC2/<0;1>/*',
          '[eb64e281/44h/1h/0h]tpubDCpbWyRPLE4oZSvng2vA8LXGKZFxuuSTgDrxFbvxZRtgMFjhJM2F6H7gjQrykHmqXShWXmXJwrpjtQhEgWNvprf9k8QYRjxmL2JeumUEK97/<0;1>/*',
          '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<0;1>/*',
          '[607d04ba/44h/1h/0h]tpubDCpjTp9e7txGnMp2jmNGDjtyvBgznTFnD51TxNW1uvpZQS7HDKQKhkYAHcZA9jBRcXY6S4pD6xkJmD7JbBfdzZptRmgwfyj8vKBrkf8F4bA/<0;1>/*'],
         '{and_v(v:multi_a(2,@0/<2;3>/*,@1/<2;3>/*,@2/<0;1>/*,@3/<0;1>/*),older(10)),multi_a(2,@0/<0;1>/*,@1/<0;1>/*)}',
         False,
         False,
         False,
         True)
psbt15 = '[encoded data, 8732 characters]'

msc16 = ('msc16',
         'XTN',
         14,
         None,
         ['[0f056943/99h/0h/0h]tpubDDjN26baDEVS3st3MXRhPod1jGchwFby8WKR84V3TVj1WhXEA6kVUPDWcbG65HTZhaxecuNZJZ7wP7mXZyFrZfnqGWKuuaTPc32g7Nuhf65/<0;1>/*'],
         'and_v(v:pk(@0/<0;1>/*),older(10))',
         False,
         True,
         False,
         False)
psbt16 = 'cHNidP8BAP0rAgIAAAABbrgOjAJDURGqMEcT+ZvA3JuqvmgIi2g+qDG6dILyxeIAAAAAAAoAAAAMKH3XFwAAAAAiACAXvREURi+bEGPEzyYwFkx40dNukTHQD7bnjKcOLEdRHACE1xcAAAAAIgAg82YwkDKmGWXF9eDgLWs799QUDU93UonnwtTelzhTwt8AhNcXAAAAACIAIIaY3fNpoRCDUokvE29CYa7GitHC+0ioTnZ0CpNNKLhaAITXFwAAAAAiACCBmi2gwuNY1gNbXGDE/AGHHAGankLwupjw8C1IiEwsxgCE1xcAAAAAIgAgaPCvuQu7QRzRyCLP12XjjQI7NkIOspATfhEMlmOH5lAAhNcXAAAAACIAIAW/NkijUIaPzVNcWm3LGVbi7/lGuV06nXgqSouWfEVkAITXFwAAAAAiACATYiODOibx/Nq31y51uVZa9OW4DUdnomgaY+cMdO3b5gCE1xcAAAAAIgAgAAo9da8XV1uysv92eYSjj+yCgOc24la2HXoi0oeOqdwAhNcXAAAAACIAIImKoP9eMyZLI4gCJ44v1RQ45dusiWpFOzvb8rK+iF0HAITXFwAAAAAiACDScnrC65oAi19Ty2UJH3UyK+ikhc8KdAlnAbvTMGn+ZgCE1xcAAAAAIgAgDUVW1cy51y6Ich2zZ+7M3ACJfQKLdQH1iBFOrRABUJsAZc0dAAAAABYAFNrW6NpeV3s7hVY60a5N5J6FGj9JAAAAAAABAH0CAAAAAVOMFtHmmW/gCS1ZvO4Ar92c/zfDiRc4Zoup882SzMCcAAAAAAD9////AgARECQBAAAAIgAgoh4qToikK9p5O5/5N/UTB6ASGc5/2RR4FbZrXLLkcGMM1fUFAAAAABYAFLJpIaWT6GxbJCK8FK3F4mVP8TNKZQAAAAEBKwARECQB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v/hTP+/SZLR+KhgPBWlDYwAAgAAAAIAAAACAAAAAAAYAAAAAAQElIQMB00zk5jbEGXF9vBsGdDdxgHsA5yqX4SGrKv707usPIq1asiICAwHTTOTmNsQZcX28GwZ0N3GAewDnKpfhIasq/vTu6w8iGA8FaUNjAACAAAAAgAAAAIAAAAAABwAAAAABASUhAx0uSVi691k9jlLnRdfxXikw/N2Yu45gRKR6r7qBZ2nirVqyIgIDHS5JWLr3WT2OUudF1/FeKTD83Zi7jmBEpHqvuoFnaeIYDwVpQ2MAAIAAAACAAAAAgAAAAAAIAAAAAAEBJSEDSlS2wv2KBnk9pc2gDmm8uXcnfUFUX/YFOxkqAEVbqOGtWrIiAgNKVLbC/YoGeT2lzaAOaby5dyd9QVRf9gU7GSoARVuo4RgPBWlDYwAAgAAAAIAAAACAAAAAAAkAAAAAAQElIQOc+KncAYX5xPuiWs31EXgN7XBJCFkhekjFD5eeo8UcQa1asiICA5z4qdwBhfnE+6JazfUReA3tcEkIWSF6SMUPl56jxRxBGA8FaUNjAACAAAAAgAAAAIAAAAAACgAAAAAA'

msc17 = ('msc17',
         'XTN',
         35,
         'tpubD6NzVbkrYhZ4XgXS51CV3bhoP5dJeQqPhEyhKPDXBgEs64VdSyAfku99gtDXQzY6HEXY5Dqdw8Qud1fYiyewDmYjKe9gGJeDx7x936ur4Ju/<0;1>/*',
         ['[0f056943/99h/0h/0h]tpubDDjN26baDEVS3st3MXRhPod1jGchwFby8WKR84V3TVj1WhXEA6kVUPDWcbG65HTZhaxecuNZJZ7wP7mXZyFrZfnqGWKuuaTPc32g7Nuhf65/<0;1>/*'],
         'and_v(v:pk(@0/<0;1>/*),older(10))',
         False,
         False,
         False,
         True)
psbt17 = '[encoded data, 4396 characters]'

msc18 = ('msc18',
         'XTN',
         14,
         None,
         ['[0f056943/84h/1h/0h]tpubDC7jGaaSE66Pn4dgtbAAstde4bCyhSUs4r3P8WhMVvPByvcRrzrwqSvpF9Ghx83Z1LfVugGRrSBko5UEKELCz9HoMv5qKmGq3fqnnbS5E9r/<0;1>/*',
          'tpubDCxa9ZSg31K2um9qcMogpVDK2YbAbMn7XqaDyBeKtFSBzHEFAJYtnXDUwBitg39d8TtucYxyKsbWJoKzxmsJbdXruxxdh6zG2LXQuBiRSCp/<0;1>/*'],
         'or_d(pk(@0/<0;1>/*),and_v(v:pkh(@1/<0;1>/*),older(100)))',
         False,
         True,
         False,
         False)
psbt18 = 'cHNidP8BAP0rAgIAAAABed/+LxRRugb+ZXBpXtwKtlfXUyTE7gTRYPjVMQ7cPbgBAAAAAP3///8M+HzXFwAAAAAiACCnAJGr1/YEXbFzRbpa9B8w251yGFycZAlnKj/s4plmIQCE1xcAAAAAIgAgzbu9x3VG6axlll4FeBaqpYAMlbdTIyWDmin+mVI/U/sAhNcXAAAAACIAIMv+6HXNzpnGwtBlQq25eQrIjdLpMXiUapQEjH9u0XEFAITXFwAAAAAiACAiXhU8VJfboKH5/r7YP3d3REUmGKoSDtoIus4velK2oQCE1xcAAAAAIgAg6XpRg2hGb/euVQCUPRvmA9FP/58hP5eoJVE5oPYsGSsAhNcXAAAAACIAIBaeY2jTqJ2GzOTDeNiue1w/C5WpE96cmEYMVg3PAjPSAITXFwAAAAAiACBJ/RF8WokIp8y1RYmwBwRubZdWPT5xwjIEOXKfiOvahgCE1xcAAAAAIgAgRvJgwL+ekPcRTVwaDLDhlbTR09/RrGAipITRAd6CSd0AhNcXAAAAACIAIKNjT2loCo2ZaHIRLs7Ai00g2wX/2ga+LpmuNlPnK8n+AITXFwAAAAAiACA+aI8gXacap/tELoqpuILLbUSCSjxr5QhlrfoEDxCzsACE1xcAAAAAIgAgGnyLaHkOpdTxgFqW8PYus1L/8lP4mdZ9KWdYFHQ/gusAZc0dAAAAABYAFFzV9puMgfhApqGrWWe4ZK/YUfB3AAAAAAABAH0CAAAAAWDo/mQ9kerhbWjmA47ZRStuEoREMJG+O1srwjEuObK0AAAAAAD9////AgzV9QUAAAAAFgAUJVH6QN7eSa6yyZqjhw6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t4qAAAAAABwAAACICA719CZGFDXWB0tGBQpRCt56Ldd0FSH7ahJTJm14r3P33GA8FaUNUAACAAQAAgAAAAIAAAAAABwAAAAABAUIhAgkK5ypWHfxPrzJHIHuA87Uj9n2kIuSoKvWEMTHN5h3ErHNkdqkUUDfVvZpzl0RndhxC10jCAAVbViiIrQFksmgiAgIJCucqVh38T68yRyB7gPO1I/Z9pCLkqCr1hDExzeYdxBgPBWlDVAAAgAEAAIAAAACAAAAAAAgAAAAiAgOrn4WqT/HCgHZiUMcK+jkfl3urCRxAzO9USfF0RxpQKAzQ7eKgAAAAAAgAAAAAAQFCIQIlOebM4u8iz9IE3lv9ECT0E62y+jmMb2b72eAtX6runqxzZHapFHYg8YNrnm6CEbltUEtdsa4NLgE7iK0BZLJoIgICJTnmzOLvIs/SBN5b/RAk9BOtsvo5jG9m+9ngLV+q7p4YDwVpQ1QAAIABAACAAAAAgAAAAAAJAAAAIgIDi/eg9JiA8pbJGbh3r7qsA8/B1FZcASexJRhAzduRS4kM0O3ioAAAAAAJAAAAAAEBQiEDcpmkt2D6oIreqDnNoDI1vNW47HRkyK2xIEPFFzhGX1+sc2R2qRQLEVoMisxnbzFXuMCqvXhKgXWdc4itAWSyaCICA3KZpLdg+qCK3qg5zaAyNbzVuOx0ZMitsSBDxRc4Rl9fGA8FaUNUAACAAQAAgAAAAIAAAAAACgAAACICA5bW4LfVkXOEZXMOGSK21rwqeddFM15nHml4zbXYLp4gDNDt4qAAAAAACgAAAAAA'

msc19 = ('msc19',
         'XTN',
         14,
         None,
         ['[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<0;1>/*',
          '[e0fa0d67/44h/1h/0h]tpubDCgP2uAUWT1mNJrSmjDuDcWoKz5A1irJLZ8NYLEmNoEKfWhr7v7EwNRFjTgYbyU12HnD2DwQBGMUimB4M5N1Rb1qJCbgUhk6ZyB2pFzz1ye/<0;1>/*',
          '[e0fa0d67/44h/1h/0h]tpubDCgP2uAUWT1mNJrSmjDuDcWoKz5A1irJLZ8NYLEmNoEKfWhr7v7EwNRFjTgYbyU12HnD2DwQBGMUimB4M5N1Rb1qJCbgUhk6ZyB2pFzz1ye/<2;3>/*',
          '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<2;3>/*',
          '[136d22cf/44h/1h/0h]tpubDDfNoDCpdfQNuBt1VaT9VEgdMMGgdJ8xKycXedazyHwAAvBU7Fr7M5HE1RtuWuAwzs79XKxXaMz87cCQjv1zVghcDsZmo96cihzt1Zkwc6t/<0;1>/*'],
         'or_d(multi(2,@0/<0;1>/*,@1/<0;1>/*),and_v(v:thresh(2,pkh(@1/<2;3>/*),a:pkh(@0/<2;3>/*),a:pkh(@2/<0;1>/*)),older(10)))',
         False,
         True,
         False,
         False)
psbt19 = '[encoded data, 5168 characters]'

msc20 = ('msc20',
         'XTN',
         35,
         '[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<0;1>/*',
         ['[0f056943/86h/1h/0h]tpubDCeEX49avtiXrBTv3JWTtco99Ka499jXdZHBRtm7va2gkMAui11ctZjqNAT9dLVNaEozt2C1kfTM88cnvZCXsWLJN2p4viGvsyGjtKVV7A1/<2;3>/*',
          '[758ce887/44h/1h/0h]tpubDCmTGaAGyukMjeL1cv5CMByjuaNULHrF5iemnVAEdQAGeNdGqqxcsyDY5Tef3HfRC6DRR8nA82Tsw51aeNdNeAieLg5vUgAWyNbKDCNTg39/<2;3>/*',
          '[80f987dd/44h/1h/0h]tpubDDCEzMY1oAUdp3MHNgrEA2Y67AsLdeaS1gJ529kbkto9NAVB76KpgxyiUQV4uiMLUK79rj67N3oSmKAwhHrxUEYFQEATEcas6jARA5Do2t6/<2;3>/*',
          '[cff263dc/44h/1h/0h]tpubDCcXPLhk177GnGXuAV5rYcxbGQHH58ddBZWk5yqyT5Syp6UX875WoXuZn3XxTkpmBp2PCUdixHuDznTom2YtcqKLtX8ksvqwvFCNKr4cgJi/<0;1>/*',
          '[758ce887/44h/1h/0h]tpubDCmTGaAGyukMjeL1cv5CMByjuaNULHrF5iemnVAEdQAGeNdGqqxcsyDY5Tef3HfRC6DRR8nA82Tsw51aeNdNeAieLg5vUgAWyNbKDCNTg39/<0;1>/*',
          '[80f987dd/44h/1h/0h]tpubDDCEzMY1oAUdp3MHNgrEA2Y67AsLdeaS1gJ529kbkto9NAVB76KpgxyiUQV4uiMLUK79rj67N3oSmKAwhHrxUEYFQEATEcas6jARA5Do2t6/<0;1>/*'],
         '{and_v(v:multi_a(2,@0/<2;3>/*,@1/<2;3>/*,@2/<2;3>/*,@3/<0;1>/*),older(10)),multi_a(2,@1/<0;1>/*,@2/<0;1>/*)}',
         False,
         False,
         False,
         True)
psbt20 = '[encoded data, 9016 characters]'


def test_miniscript(settings_get, settings_set, clear_miniscript, goto_home, pick_menu_item,
                    cap_menu, try_sign):

    # try one by one
    for msc, psbt in [(msc0, psbt0), (msc1, psbt1), (msc2, psbt2), (msc3, psbt3), (msc4, psbt4),
                      (msc5, psbt5), (msc6, psbt6), (msc7, psbt7), (msc8, psbt8),(msc9, psbt9),
                      (msc10, psbt10), (msc11, psbt11), (msc12, psbt12), (msc14, psbt14),
                      (msc15, psbt15), (msc16, psbt16), (msc17, psbt17), (msc18, psbt18),
                      (msc19, psbt19), (msc20, psbt20)]:

        clear_miniscript()
        name = msc[0]
        print(name)  # debug in case of failure
        settings_set("miniscript", [msc])
        goto_home()
        pick_menu_item("Settings")
        pick_menu_item("Multisig/Miniscript")  # migration happens here as we start deserializing the wallets
        time.sleep(.1)
        assert name in cap_menu()
        res = settings_get("miniscript")
        assert len(res) == 1
        assert len(res[0]) == 4  # new format (name, policy, keys, opts)
        assert res[0][0] == name
        try_sign(base64.b64decode(psbt))


def test_big_guys(microsd_path, src_root_dir, goto_home, pick_menu_item, need_keypress,
                  set_seed_words, microsd_wipe, enter_complex, press_select, cap_story,
                  settings_get, press_cancel):
    # unable to import via settings_set (USB max size)
    # so good place to test migration via backup
    #
    fname0 = "big_boy_naked.7z"
    psbt0 = '[encoded data, 65628 characters]'

    fname1 = "big_boy.7z"
    psbt1 = '[encoded data, 71004 characters]'
    for fname, psbt in [(fname0, psbt0), (fname1, psbt1)]:
        print(fname)  # debug
        microsd_wipe()
        shutil.copy(f"{src_root_dir}/testing/data/migration_640/{fname}", microsd_path(""))
        # need some other seed as main secret as we are gonna use simulator words as tmp seed
        set_seed_words("type goat number acoustic embark allow onion express monitor pudding mutual thank")
        goto_home()
        pick_menu_item("Advanced/Tools")
        pick_menu_item("Danger Zone")
        pick_menu_item("I Am Developer.")
        pick_menu_item("Restore Bkup")
        pick_menu_item(fname)
        time.sleep(.1)
        enter_complex(32*"a", apply=False, b39pass=False)
        time.sleep(.5)
        press_select()
        time.sleep(.1)
        press_select()

        with open(microsd_path(fname.split(".")[0]+".psbt"), "w") as f:
            f.write(psbt)

        pick_menu_item("Ready To Sign")
        time.sleep(1)
        title, story = cap_story()
        assert "OK TO SEND" in title
        press_select()
        time.sleep(1)
        title, stoty = cap_story()
        assert title == "PSBT Signed"

        msc = settings_get("miniscript")
        assert len(msc) == 1
        assert len(msc[0]) == 4  # new format
        press_cancel()


def test_anchor_bug(goto_home, pick_menu_item, microsd_path, src_root_dir, press_select,
                    unit_test, cap_menu):
    fname = "bonus101.txt"
    shutil.copy(f"{src_root_dir}/testing/data/migration_640/{fname}", microsd_path(""))
    # unit_test('devtest/clear_seed.py')
    goto_home()
    pick_menu_item("Advanced/Tools")
    pick_menu_item("Danger Zone")
    pick_menu_item("I Am Developer.")
    pick_menu_item("Restore Bkup")
    pick_menu_item(fname)
    time.sleep(.1)
    press_select()

    time.sleep(.1)
    press_select()

    goto_home()
    pick_menu_item("Settings")
    pick_menu_item("Multisig/Miniscript")
    time.sleep(2)
    m = cap_menu()
    assert len(m) == 17
    assert all(len(name) <= 30 for name in m)

# EOF