Skip to content

Commit

Permalink
WIP: unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Jan 20, 2025
1 parent 3bf58af commit 00c7b83
Show file tree
Hide file tree
Showing 2 changed files with 507 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pkg/local_object_storage/metabase/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var (
maxUint256Neg = new(big.Int).Neg(maxUint256)
)

// TODO: fill on Init
// TODO: system attributes
// TODO: fill on migration
// TODO: sort integers in buckets naturally
func putMetadata(tx *bbolt.Tx, cnr cid.ID, id oid.ID, ver version.Version, owner user.ID, typ object.Type, creationEpoch uint64,
payloadLen uint64, pldHash, pldHmmHash, splitID []byte, parentID, firstID oid.ID, attrs []object.Attribute) error {
mb, err := tx.CreateBucketIfNotExists(metaBucketKey(cnr))
Expand Down Expand Up @@ -86,7 +86,6 @@ func putMetadata(tx *bbolt.Tx, cnr cid.ID, id oid.ID, ver version.Version, owner
return nil
}
putInt := func(attr string, n *big.Int) error {
// TODO: check uint256 overflow
kLn, vOff := makeKeyB(metaPrefixBI, attr, 1+32) // sign + 256-bit. Sign makes some sensible order
if n.Sign() >= 0 {
k[vOff] = 1
Expand Down
Loading

0 comments on commit 00c7b83

Please sign in to comment.