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.
Summary
Approximately 50 tests in the
Invariants_test.cppfile are using an incorrect way to fetch a Vault ledger-object. They make use of ApplyView'sseq()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
Precloselambda.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
sequencenumbers.