-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store substate_id in events (#986)
Description --- * Updated the `events` database table for the new field * Updated database API and managers to use substate ids instead of component addresses * Builtin vault events (e.g. `std.vault.deposit`) now emit two events: one has the vault as `substate_id` and the other has the resource. This is done to allow queries by both criteria Motivation and Context --- Up until now events stored the component address related to it. This is not general enough now because we want also to emit events that can be related to other type of substates (e.g. resources or vaults). This PR changes the `component_address` field for `substate_id` for events in the whole project (from database to APIs) How Has This Been Tested? --- * Existing unit and integration tests pass. * Manually inspected the content of the new `substate_id` field in different types of events What process can a PR reviewer use to test or verify this change? --- Emit any type of event and check the new `substate_id` field value Breaking Changes --- - [ ] None - [ ] Requires data directory to be deleted - [x] Event fields change (`substate_id` instead of `component_address`) so it requires network reset --------- Co-authored-by: Stan Bondi <sdbondi@users.noreply.github.com>
- Loading branch information
Showing
25 changed files
with
394 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...src/substate_storage_sqlite/migrations/2024-03-21-212928_refactor_event_substate/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- This file should undo anything in `up.sql` |
2 changes: 2 additions & 0 deletions
2
...r/src/substate_storage_sqlite/migrations/2024-03-21-212928_refactor_event_substate/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alter table events | ||
rename column component_address to substate_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.