You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.8 KiB

  1. package memory
  2. import (
  3. "github.com/iden3/go-merkletree"
  4. "testing"
  5. "github.com/iden3/go-merkletree/db/test"
  6. "github.com/stretchr/testify/require"
  7. )
  8. func TestMemoryStorageInterface(t *testing.T) {
  9. var db merkletree.Storage //nolint:gosimple
  10. db = NewMemoryStorage()
  11. require.NotNil(t, db)
  12. }
  13. func TestMemory(t *testing.T) {
  14. test.TestReturnKnownErrIfNotExists(t, NewMemoryStorage())
  15. test.TestStorageInsertGet(t, NewMemoryStorage())
  16. test.TestStorageWithPrefix(t, NewMemoryStorage())
  17. test.TestConcatTx(t, NewMemoryStorage())
  18. test.TestList(t, NewMemoryStorage())
  19. test.TestIterate(t, NewMemoryStorage())
  20. test.TestNewTree(t, NewMemoryStorage())
  21. test.TestAddDifferentOrder(t, NewMemoryStorage(), NewMemoryStorage())
  22. test.TestAddRepeatedIndex(t, NewMemoryStorage())
  23. test.TestGet(t, NewMemoryStorage())
  24. test.TestUpdate(t, NewMemoryStorage())
  25. test.TestUpdate2(t, NewMemoryStorage())
  26. test.TestGenerateAndVerifyProof128(t, NewMemoryStorage())
  27. test.TestTreeLimit(t, NewMemoryStorage())
  28. test.TestSiblingsFromProof(t, NewMemoryStorage())
  29. test.TestVerifyProofCases(t, NewMemoryStorage())
  30. test.TestVerifyProofFalse(t, NewMemoryStorage())
  31. test.TestGraphViz(t, NewMemoryStorage())
  32. test.TestDelete(t, NewMemoryStorage())
  33. test.TestDelete2(t, NewMemoryStorage(), NewMemoryStorage())
  34. test.TestDelete3(t, NewMemoryStorage(), NewMemoryStorage())
  35. test.TestDelete4(t, NewMemoryStorage(), NewMemoryStorage())
  36. test.TestDelete5(t, NewMemoryStorage(), NewMemoryStorage())
  37. test.TestDeleteNonExistingKeys(t, NewMemoryStorage())
  38. test.TestDumpLeafsImportLeafs(t, NewMemoryStorage(), NewMemoryStorage())
  39. test.TestAddAndGetCircomProof(t, NewMemoryStorage())
  40. test.TestUpdateCircomProcessorProof(t, NewMemoryStorage())
  41. test.TestSmtVerifier(t, NewMemoryStorage())
  42. test.TestTypesMarshalers(t, NewMemoryStorage())
  43. }