Skip to content

Commit

Permalink
feat(logic): specify user output support
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Apr 5, 2023
1 parent 71fbaeb commit 6343864
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 32 deletions.
9 changes: 9 additions & 0 deletions proto/logic/v1beta2/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ message Limits {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint",
(gogoproto.nullable) = true
];

// max_user_output_size specifies the maximum number of bytes to keep in the user output. If the user output exceeds
// this size, the interpreter will overwrite the oldest bytes with the new ones to keep the size constant.
// nil value or 0 value means that no user output is used at all.
string max_user_output_size = 4 [
(gogoproto.moretags) = "yaml:\"max_user_output_size\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint",
(gogoproto.nullable) = true
];
}

// Interpreter defines the various parameters for the interpreter.
Expand Down
3 changes: 3 additions & 0 deletions proto/logic/v1beta2/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ message QueryServiceAskResponse {
uint64 gas_used = 2 [(gogoproto.moretags) = "yaml:\"gas_used\",omitempty"];
// answer is the answer to the query.
Answer answer = 3 [(gogoproto.moretags) = "yaml:\"answer\",omitempty"];
// user_output is the output of the query execution, if any.
// the length of the output is limited by the max_query_output_size parameter.
string user_output = 4 [(gogoproto.moretags) = "yaml:\"user_output\",omitempty"];
}
56 changes: 56 additions & 0 deletions x/logic/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

119 changes: 87 additions & 32 deletions x/logic/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6343864

Please sign in to comment.