Skip to content

test(rs-sdk): sdk_builder_default_seeds_atomic_to_floor expects pre-floor protocol version #3933

Description

@thepastaclaw

Summary

The dash-sdk::main fetch::document_query_v0_v1::sdk_builder_default_seeds_atomic_to_floor test currently fails on v3.1-dev.

Failure

CI log from dashpay/platform#3930:
https://github.com/dashpay/platform/actions/runs/27727297416/job/82026423404

Failure excerpt:

thread 'fetch::document_query_v0_v1::sdk_builder_default_seeds_atomic_to_floor' panicked at packages/rs-sdk/tests/fetch/document_query_v0_v1.rs:227:5:
assertion `left == right` failed
  left: 11
 right: 10

Diagnosis

This appears to be deterministic pre-existing test breakage, not related to dashpay/platform#3930.

The test asserts that a fresh SdkBuilder::new_mock().build() returns DEFAULT_INITIAL_PROTOCOL_VERSION (10). Current SDK construction clamps the seeded protocol version to the per-network floor:

let initial_protocol_version = self
    .version
    .protocol_version
    .max(min_protocol_version(self.network));

SdkBuilder::new_mock() defaults to Network::Mainnet, and min_protocol_version(Network::Mainnet) is 11, so the observed protocol version is 11.

Reproduction

On current upstream/v3.1-dev (d91c1e739959eb4011c8659f56d9343083e29255):

cargo test -p dash-sdk --all-features --test main fetch::document_query_v0_v1::sdk_builder_default_seeds_atomic_to_floor -- --exact --nocapture

Result: same assertion failure (left: 11, right: 10).

Expected fix direction

Either update the test expectation to account for the network floor (max(DEFAULT_INITIAL_PROTOCOL_VERSION, min_protocol_version(network))) or update the SDK/default mock behavior if the current clamp is not intended for this test path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions