Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cognitarium schema #46

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading
Loading