Skip to content

Commit

Permalink
Merge pull request #46 from axone-protocol/chore/cognitarium-new-schema
Browse files Browse the repository at this point in the history
New cognitarium schema
  • Loading branch information
bdeneux authored Aug 23, 2024
2 parents 766ea21 + 8eaef30 commit 5481997
Show file tree
Hide file tree
Showing 3 changed files with 2,629 additions and 2,028 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
Loading

0 comments on commit 5481997

Please sign in to comment.