-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: adding basic tally structure #272
Conversation
} | ||
|
||
// 4. Post result. | ||
// msg := []byte("{\"data_requests\": {}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not relevant yet; just linking the appropriate rust for the json.
https://github.com/sedaprotocol/seda-common-rs/blob/main/src/msgs/data_requests/types.rs#L112
Should be ready to be merged now as tally works until VM execution, which fails with an error. The execution phase can be addressed in a new PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🎉
some minor nitpicks.
keys := make([]string, len(req.Reveals)) | ||
i := 0 | ||
for k := range req.Reveals { | ||
keys[i] = k | ||
i++ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keys := make([]string, len(req.Reveals)) | |
i := 0 | |
for k := range req.Reveals { | |
keys[i] = k | |
i++ | |
} | |
keys := make([]string, 0, len(req.Reveals)) | |
for k := range req.Reveals { | |
keys = append(keys, k) | |
} |
Explanation of Changes
This PR implements the basic tally structure in the endblocker of the wasm-storage module. The endblocker first fetches tally-ready data requests from the SEDA contract, whose address is registered during the instantiation process. Then, the tally wasm associated with each of the data requests is executed on tally VM. The major missing parts are:
The PR also includes:
Testing
Currently, the tally mechanism is tested using a mock function that mocks the SEDA contract's
requests_by_status
query endpoint.Closes #127 and #53 and #281