-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fix query
#1402
Fix query
#1402
Changes from all commits
8c72024
9a08d8f
d227463
fed71d1
7d5a80d
3db6a4d
8f15460
532e4da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -110,6 +110,11 @@ pub enum SourceChainError { | |||||
#[error("The source chain was missing for a host call that requires it.")] | ||||||
SourceChainMissing, | ||||||
|
||||||
#[error("The supplied query parameters contains filters that are mutually incompatible. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
In particular, `sequence_range` cannot currently be used with any other filter. | ||||||
In the future, all filters will be compatible with each other and this will not be an error.")] | ||||||
UnsupportedQuery(ChainQueryFilter), | ||||||
|
||||||
/// Other | ||||||
#[error("Other: {0}")] | ||||||
Other(Box<dyn std::error::Error + Send + Sync>), | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,8 @@ impl Default for ChainQueryFilterRange { | |
#[derive( | ||
serde::Serialize, serde::Deserialize, SerializedBytes, Default, PartialEq, Clone, Debug, | ||
)] | ||
#[non_exhaustive] | ||
// TODO: get feedback on whether it's OK to remove non_exhaustive | ||
// #[non_exhaustive] | ||
Comment on lines
+64
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed non_exhaustive just because I was lazy and wanted it to be easier to write my test. Also I don't think our API is stable enough to warrant niceties like this yet. I will put it back in if anyone wants it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
is this statement specific to the query API? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we ever want this, it'll be easier to include it sooner, specifically because of things like tests getting written without it. But I don't have an opinion otherwise. |
||
pub struct ChainQueryFilter { | ||
/// Limit the results to a range of records according to their actions. | ||
pub sequence_range: ChainQueryFilterRange, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
subtle-encoding is already in our dependency tree, should we make use of that rather than re-inventing the wheel again, or do we want to keep that out of holo_hash specifically?
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.
I'll do that as a quick follow-up, since we already had it reinvented twice before I added a third
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.
Actually, the instance of this in
holo_hash
should not be replaced with subtle-encoding, since that would require pulling in that dependency, andto_hex()
could be something useful in wasm which shouldn't require a whole extra dependency of bloat. So the case for DRYing up the remaining two instances is less compelling.