Skip to content

Invariant_tests: Incorrect transaction-seq in Vault-object ID creation (Version: [xrpld v3.4.0]) #8056

Description

@ckeshava

Summary

Approximately 50 tests in the Invariants_test.cpp file are using an incorrect way to fetch a Vault ledger-object. They make use of ApplyView's seq() method which returns the LedgerIndex, when they should be fetching the transaction-sequence which created the Vault-ledger-object.
This comment shows a specific case of this error in a Vault-related Invariant test.

Motivation

To ensure that the tests are not brittle to unrelated updates in the test infrastructure, we should fix this bug.

Solution

We need to make use of the exact keylet which was used to create the vault. This value needs to be returned from Preclose lambda.

Paths Not Taken

Alternatively, the PreClose lambda will need to return the "sequenceNum" which was used to create the Vault-object. However, some of the tests create multiple vaults. In this case, readability will take a hit in the design involving returning sequence numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestUsed to indicate requests to add new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions