Closed aarmoa closed 3 months ago
[!CAUTION]
Review failed
The pull request is closed.
The changes introduce a comprehensive permissions management system within the blockchain client, enhancing the ChainClient
interface with multiple new methods for querying permissions-related data. This modular approach allows for better control over access and roles associated with blockchain namespaces. Additionally, new test cases and examples illustrate how to implement and interact with these features, promoting usability and developer engagement.
Files | Change Summary |
---|---|
client/chain/chain.go |
Enhanced ChainClient with new permission-related methods; added permissionsQueryClient . |
client/chain/chain_test.go , |
Updated test functions to use "devnet" instead of "testnet". |
client/chain/chain_test_support.go |
Added new methods to MockChainClient for permissions queries. |
client/common/network.go |
Simplified LoadNetwork function, removing detailed handling for "testnet" and "mainnet". |
examples/chain/permissions/1_CreateNamespace/example.go |
Implemented namespace creation with permissions. |
examples/chain/permissions/2_DeleteNamespace/example.go |
Implemented functionality to delete a namespace. |
examples/chain/permissions/3_UpdateNamespace/example.go |
Allowed updating of a namespace's permissions. |
examples/chain/permissions/4_UpdateNamespaceRoles/example.go |
Added capability to update roles within a namespace. |
examples/chain/permissions/5_RevokeNamespaceRoles/example.go |
Implemented role revocation for a namespace. |
examples/chain/permissions/6_ClaimVoucher/example.go |
Facilitated claiming of vouchers on the blockchain. |
examples/chain/permissions/query/1_AllNamespaces/example.go |
Created a tool to fetch all namespaces. |
examples/chain/permissions/query/2_NamespaceByDenom/example.go |
Implemented fetching namespace by denomination. |
examples/chain/permissions/query/3_AddressRoles/example.go |
Enabled queries for roles associated with an address. |
examples/chain/permissions/query/4_AddressesByRole/example.go |
Retrieved addresses linked to a specific role. |
examples/chain/permissions/query/5_VouchersForAddress/example.go |
Implemented fetching vouchers associated with an address. |
sequenceDiagram
participant User
participant ChainClient
participant Blockchain
User->>ChainClient: Create Namespace with Permissions
ChainClient->>Blockchain: Send MsgCreateNamespace
Blockchain-->>ChainClient: Confirmation
ChainClient-->>User: Success Response
sequenceDiagram
participant User
participant ChainClient
participant Blockchain
User->>ChainClient: Fetch All Namespaces
ChainClient->>Blockchain: Query All Namespaces
Blockchain-->>ChainClient: Namespaces Data
ChainClient-->>User: Display Namespaces
A Bunny's Delight
In fields of code, I hop with glee,
New permissions bloom, as fresh as can be!
With roles and namespaces, all in a row,
I dance through the changes, watch my garden grow.
π°β¨
Added support in the SDK for the permissions module's queries and messages Included examples for the queries and messages
Summary by CodeRabbit