Skip to content

Business logic error: PrefixDB unit tests #336

Description

@ivansukach

https://github.com/tendermint/tm-db/blob/master/prefixdb_test.go#L120

For each iteration you are going through values [0; len(mine)) for key := range mine {
and allocate slice of 4 bytes bs := make([]byte, 4)
Then you splitting into 4 bytes golang runes in reverse order binary.LittleEndian.PutUint32(bs, uint32(key))
Finally
if err := db.Delete(bs); err != nil {
t.Errorf("Delete %q: %v", key, err)
}

You try to delete element by the index of rune in the key pattern in little-endian order.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions