Skip to content

Combined descriptor successfully parsed as Network.testnet #174

Description

@ethicnology

This is a descriptor mainnet / xpub generated by ColdCard wpkh([182551a3/84h/0h/0h]xpub6DM9LRnPTBFRREps8bsNhfGKZ9Phwz6QSWG4iwdxLF2jfMKCncXD7pMyZhjWXmD8QQGPa1ENYZuvV8shstsZmfpZKAXinpoweXCuNBMc5uz/<0;1>/*)#4f2pnnww

This combined descriptor should be either parsed or not parsed, but I found out that it's not parsed using bdk.Network.bitcoin and it's properly parsed if I use bdk.Network.testnet.

    test('mainnet combined descriptor should work on mainnet', () async {
      expect(() async {
        await bdk.Descriptor.create(
          descriptor: combinedDescriptor,
          network: bdk.Network.bitcoin,
        );
      }, returnsNormally);
    });

    test('mainnet combined descriptor shouldnt work on testnet', () async {
      expect(() async {
        await bdk.Descriptor.create(
          descriptor: combinedDescriptor,
          network: bdk.Network.testnet,
        );
      }, throwsA(anything));
    });

🔴

00:13 +6 -2: Integration Tests Descriptor mainnet combined descriptor should work on mainnet [E]
  KeyException( Invalid network )
  package:bdk_flutter/src/root.dart 298:7   

🤯

00:13 +6 -3: Integration Tests Descriptor mainnet combined descriptor shouldnt work on testnet [E]
descriptor: 

// properly parsed !
wpkh([182551a3/84'/0'/0']xpub6DM9LRnPTBFRREps8bsNhfGKZ9Phwz6QSWG4iwdxLF2jfMKCncXD7pMyZhjWXmD8QQGPa1ENYZuvV8shstsZmfpZKAXinpoweXCuNBMc5uz/<0;1>/*)#zph0ljyn

  Expected: throws anything
    Actual: <Closure: () => Future<Null>>
     Which: returned a Future that emitted <null>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions