{"begin",RPCArg::Type::NUM,RPCArg::Optional::OMITTED_NAMED_ARG,"If a ranged descriptor is used, this specifies the beginning of the range to import."},
{"end",RPCArg::Type::NUM,RPCArg::Optional::OMITTED_NAMED_ARG,"If a ranged descriptor is used, this specifies the end of the range to import."}
{"range",RPCArg::Type::RANGE,RPCArg::Optional::OMITTED_NAMED_ARG,"If a ranged descriptor is used, this specifies the end or the range (in [begin,end] notation) to derive."},
assert_raises_rpc_error(-8,"Range should not be specified for an un-ranged descriptor",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)"),0,2)
assert_raises_rpc_error(-8,"Range should not be specified for an un-ranged descriptor",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)"),[0,2])
assert_raises_rpc_error(-8,"Range must be specified for a ranged descriptor",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"))
assert_raises_rpc_error(-8,"Missing range end parameter",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"), 0)
assert_raises_rpc_error(-8,"End of range is too high",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"),10000000000)
assert_raises_rpc_error(-8,"Range end should be equal to or greater than begin",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"),2,0)
assert_raises_rpc_error(-8,"Range is too large",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"),[1000000000,2000000000])
assert_raises_rpc_error(-8,"Range should be greater or equal than 0",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"),-1,0)
assert_raises_rpc_error(-8,"Range specified as [begin,end] must not have begin after end",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"),[2,0])
assert_raises_rpc_error(-8,"Range should be greater or equal than 0",self.nodes[0].deriveaddresses,descsum_create("wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/*)"),[-1,0])