fields: fix 32-bit time truncation
This commit fixes a problem that would incorrectly construct time.Time's on 32-bit
platforms by truncating the time value when casting to a uint.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
Revert "fix(orchard): restrict Recent() to requested node type"
This reverts commit 42d741f66ed5ac5e6217d978e6a8b31fb4f0f415.
I believe that this commit was an erroneous fix that only covered up
the real problem addressed later. The real issue was dangling references
to nodes that should have been deleted.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix(orchard): properly delete child index records
Previously this only handled child records that were single entries,
not those with an associated bucket.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: delete nodes from all indicies in RemoveSubtree
This adds a helper method to the internal index type
to facilitate deleting values from a bucket thatmay have
stored the values within a subbucket. It uses this helper
to properly delete the nodes from all of the various indicies
that they are stored in within the db.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
test(store): ensure deleted nodes are truly gone
The orchard has a bug in which a deleted node can still appear in
some list output because the node wasn't removed from every index.
This adds tests for all store implementations to catch similar mistakes
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
feat(cmd/forest): add to-bolt-key subcommand
This makes it much easier to find nodes within boltbrowser
when debugging orchard.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix(orchard): restrict Recent() to requested node type
Without this change, Orchard.Recent() would return errors
whenever its age-based iteration processed a node of a
type other than the requested type. This alters the logic
to simply skip nodes of the wrong type.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
fix: copy bytes before deserializing
This prevents deserialized structures from retaining
pointers into memory owned by bbolt, which may choose
to recycle the memory outside of query transactions.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>