-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): [NET-1316] Use
StreamRegistry
v5 permission methods (#2780)
**NOTE: Do not make releases until we've deployed `StreamRegistry` v5 to production.** ## Summary Updated the sdk to use `StreamRegistry` v5 instead of v4. In v5 there are `*forUserId`-permission methods which support arbitrary length user ids. The API is same for all permission types, but longer/shorter IDs is can be used only for publish and subscribe permissions. as there is no contract-level support for other types (edit, grant, delete). ## Changes Replaced usage: - `hasPermission`, `hasDirectPermission` -> `getPermissionsForUserId`, `getDirectPermissionsForUserId` - i.e. read a permissions struct instead of reading a boolean - it still is ok to use `hasPublicPermission` contract call to check public access, no changes in that logic - `grantPermission` -> `grantPermissionForUserId` - `revokePermission` -> `revokePermissionForUserId` - `setPermissionsMultipleStreams` -> `setMultipleStreamPermissionsForUserIds` Also changed The Graph queries to use `userId` instead of `userAddress`. ## Refactoring Refactoring the internal call flow in `StreamRegistry` by introducing a helper method `isStreamPublisherOrSubscriber_nonCached`. ## Tests Changed `randomUserId` to return random-length user ids.
- Loading branch information
Showing
12 changed files
with
680 additions
and
500 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.