Skip to content

Commit

Permalink
group_intents table methods (#309)
Browse files Browse the repository at this point in the history
* Add key_store table and generate

* Implement store/fetch/delete traits

* Add SQL key store

* Use SQL key store for provider, remove in-memory key store

* Use reference to encrypted store to allow multiple consumers

* Tidy identity

* Add identity table, queries, and unit tests

* Persist and retrieve identity from storage inside builder

* Tidy up names and types

* Add tests and fix bugs

* Fix lints

* Update xmtp_mls/src/storage/encrypted_store/mod.rs

Co-authored-by: Andrew Plaza <[email protected]>

* Dont use the word Error in error names

* Move identity initialization to identity strategy

* Refactor DB stuff into multiple files

* Delete models.rs

* Cleanup

* Add kind to group_messages

* default for SqlKeyStore, scaffolding

* fetch and store

* make fetch and store a macro

* fix

* fix store_read_delete test

* add group membership state enum

* tests and some more fetch & store impls. tracing-subscriber for tests

* some docs

* fix group membership enum

* clippy

* remove outbound_welcome_messages

* Break up table

* Revert "Break up table"

This reverts commit 157ce6a.

* Break up fetch and store macros

* Add helpers for enums

* Add intent methods

* Add some comments

---------

Co-authored-by: Richard Hua <[email protected]>
Co-authored-by: Richard Hua <[email protected]>
Co-authored-by: Andrew Plaza <[email protected]>
Co-authored-by: Andrew Plaza <[email protected]>
  • Loading branch information
5 people authored Nov 3, 2023
1 parent af023eb commit 129e3c4
Show file tree
Hide file tree
Showing 3 changed files with 539 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ CREATE TABLE group_intents (
-- INTENT_STATE,
"state" INT NOT NULL,
-- The hash of the encrypted, concrete, form of the message if it was published.
"payload_hash" BLOB,
"payload_hash" BLOB UNIQUE,
-- (Optional) data needed for the post-commit flow. For example, welcome messages
"post_commit_data" BLOB,
FOREIGN KEY (group_id) REFERENCES groups(id)
);

CREATE INDEX group_intents_group_id_id ON group_intents(group_id, id);
CREATE INDEX group_intents_group_id_state ON group_intents(group_id, state);
Loading

0 comments on commit 129e3c4

Please sign in to comment.