-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared.go
More file actions
28 lines (24 loc) · 867 Bytes
/
shared.go
File metadata and controls
28 lines (24 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package sdk
import (
"context"
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)
// SharedClient interacts with the on-chain shared module.
//
// - Used to get shared module parameters such as grace period, session length, etc.
// - Simple client that directly embeds the QueryClient for straightforward usage
type SharedClient struct {
sharedtypes.QueryClient
}
// GetParams returns the shared module parameters from the blockchain.
//
// - Returns the current shared module parameters including grace period, session configuration, etc.
// - Returns error if context deadline is exceeded or query fails
func (sc *SharedClient) GetParams(ctx context.Context) (sharedtypes.Params, error) {
req := &sharedtypes.QueryParamsRequest{}
res, err := sc.Params(ctx, req)
if err != nil {
return sharedtypes.Params{}, err
}
return res.Params, nil
}