Skip to content

Commit

Permalink
chore(cognitarium): new client
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Aug 22, 2024
1 parent e351d2a commit 8eaef30
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions go/cognitarium-schema/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func (q *queryClient) queryContract(ctx context.Context, rawQueryData []byte, op
return out.Data, nil
}

func (q *queryClient) Store(ctx context.Context, req *QueryMsg_Store, opts ...grpc.CallOption) (*StoreResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"store": req})
func (q *queryClient) Construct(ctx context.Context, req *QueryMsg_Construct, opts ...grpc.CallOption) (*ConstructResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"construct": req})
if err != nil {
return nil, err
}
Expand All @@ -78,16 +78,16 @@ func (q *queryClient) Store(ctx context.Context, req *QueryMsg_Store, opts ...gr
return nil, err
}

var response StoreResponse
var response ConstructResponse
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}

return &response, nil
}

func (q *queryClient) Construct(ctx context.Context, req *QueryMsg_Construct, opts ...grpc.CallOption) (*ConstructResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"construct": req})
func (q *queryClient) Describe(ctx context.Context, req *QueryMsg_Describe, opts ...grpc.CallOption) (*DescribeResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"describe": req})
if err != nil {
return nil, err
}
Expand All @@ -97,16 +97,16 @@ func (q *queryClient) Construct(ctx context.Context, req *QueryMsg_Construct, op
return nil, err
}

var response ConstructResponse
var response DescribeResponse
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}

return &response, nil
}

func (q *queryClient) Describe(ctx context.Context, req *QueryMsg_Describe, opts ...grpc.CallOption) (*DescribeResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"describe": req})
func (q *queryClient) Select(ctx context.Context, req *QueryMsg_Select, opts ...grpc.CallOption) (*SelectResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"select": req})
if err != nil {
return nil, err
}
Expand All @@ -116,16 +116,16 @@ func (q *queryClient) Describe(ctx context.Context, req *QueryMsg_Describe, opts
return nil, err
}

var response DescribeResponse
var response SelectResponse
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}

return &response, nil
}

func (q *queryClient) Select(ctx context.Context, req *QueryMsg_Select, opts ...grpc.CallOption) (*SelectResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"select": req})
func (q *queryClient) Store(ctx context.Context, req *QueryMsg_Store, opts ...grpc.CallOption) (*StoreResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"store": req})
if err != nil {
return nil, err
}
Expand All @@ -135,7 +135,7 @@ func (q *queryClient) Select(ctx context.Context, req *QueryMsg_Select, opts ...
return nil, err
}

var response SelectResponse
var response StoreResponse
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}
Expand Down

0 comments on commit 8eaef30

Please sign in to comment.