From 3965e8c06095581181f7460c069000d0e8b7640d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=AD=90=EF=B8=8FNINIKA=E2=AD=90=EF=B8=8F?= Date: Mon, 18 Nov 2024 11:35:43 +0300 Subject: [PATCH] refactor(queries): update documentation for the query dsl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ⭐️NINIKA⭐️ --- crates/iroha_core/src/query/cursor.rs | 5 +- .../src/query/builder/batch_downcast.rs | 43 - .../iroha_data_model/src/query/builder/mod.rs | 3 + .../src/query/dsl/compound_predicate.rs | 10 + crates/iroha_data_model/src/query/dsl/mod.rs | 98 +- .../src/query/dsl/predicates.rs | 22 +- .../src/query/dsl/selector_traits.rs | 12 +- .../src/query/dsl/selector_tuple.rs | 23 +- .../src/query/dsl/type_descriptions.rs | 13 +- crates/iroha_data_model/src/query/mod.rs | 9 +- docs/source/references/schema.json | 1262 ++++++++++++++--- 11 files changed, 1207 insertions(+), 293 deletions(-) diff --git a/crates/iroha_core/src/query/cursor.rs b/crates/iroha_core/src/query/cursor.rs index 4c60d87517a..fad98fcb255 100644 --- a/crates/iroha_core/src/query/cursor.rs +++ b/crates/iroha_core/src/query/cursor.rs @@ -45,6 +45,7 @@ where while let Some(item) = iter.next() { if iter.peek().is_none() { + // do not clone the last item batch_tuple.push(item.project(batch.into_iter())); return QueryOutputBatchBoxTuple { tuple: batch_tuple }; } @@ -141,7 +142,7 @@ where } } -/// A query output iterator that combines batching and type erasure. +/// A query output iterator that combines evaluating selectors, batching and type erasure. pub struct ErasedQueryIterator { inner: Box, } @@ -153,7 +154,7 @@ impl Debug for ErasedQueryIterator { } impl ErasedQueryIterator { - /// Creates a new batched iterator. Boxes the inner iterator to erase its type. + /// Creates a new erased query iterator. Boxes the inner iterator to erase its type. pub fn new(iter: I, selector: SelectorTuple, batch_size: NonZeroU64) -> Self where I: ExactSizeIterator + Send + Sync + 'static, diff --git a/crates/iroha_data_model/src/query/builder/batch_downcast.rs b/crates/iroha_data_model/src/query/builder/batch_downcast.rs index 33edede9195..230d023dfeb 100644 --- a/crates/iroha_data_model/src/query/builder/batch_downcast.rs +++ b/crates/iroha_data_model/src/query/builder/batch_downcast.rs @@ -68,14 +68,6 @@ where } macro_rules! typed_batch_tuple { - // (@repeat_none @recur) => {}; - // (@repeat_none @recur $dummy1:ident $($rest:ident)*) => { - // None, typed_batch_tuple!(@repeat_none @recur $($rest)*) - // }; - // (@repeat_none $($rest:ident)*) => { - // (typed_batch_tuple!(@repeat_none @recur $($rest)*)) - // }; - // (@first $first:tt $($rest:tt)*) => { $first }; ( $( $name:ident($($ty_name:ident: $ty:ident),+); @@ -160,38 +152,3 @@ typed_batch_tuple! { TypedBatch8(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8); // who needs more than 8 values in their query, right? } - -// pub struct QueryIterator -// where -// T: HasTypedBatchIter, -// { -// batch: T::TypedBatchIter, -// // TODO: include the query executor in here -// } -// -// impl QueryIterator -// where -// T: HasTypedBatchIter, -// { -// pub fn new(first_batch: QueryOutputBatchBoxTuple) -> Result { -// let batch = T::downcast(first_batch)?; -// -// Ok(Self { batch }) -// } -// } -// -// impl Iterator for QueryIterator -// where -// T: HasTypedBatchIter, -// { -// type Item = Result; -// -// fn next(&mut self) -> Option { -// if let Some(item) = self.batch.next() { -// return Some(Ok(item)); -// } -// -// // TODO: request next batch -// None -// } -// } diff --git a/crates/iroha_data_model/src/query/builder/mod.rs b/crates/iroha_data_model/src/query/builder/mod.rs index 99469dd05e6..71d752c6300 100644 --- a/crates/iroha_data_model/src/query/builder/mod.rs +++ b/crates/iroha_data_model/src/query/builder/mod.rs @@ -167,6 +167,9 @@ where self.filter(predicate_builder(Default::default())) } + /// Return only the fields of the results specified by the given closure. + /// + /// You can select multiple fields by returning a tuple from the closure. #[must_use] pub fn select_with(self, f: B) -> QueryBuilder<'a, E, Q, O::SelectedTuple> where diff --git a/crates/iroha_data_model/src/query/dsl/compound_predicate.rs b/crates/iroha_data_model/src/query/dsl/compound_predicate.rs index 4f388988a29..b2535510611 100644 --- a/crates/iroha_data_model/src/query/dsl/compound_predicate.rs +++ b/crates/iroha_data_model/src/query/dsl/compound_predicate.rs @@ -11,18 +11,26 @@ use crate::query::dsl::{ BaseProjector, EvaluatePredicate, HasProjection, HasPrototype, PredicateMarker, }; +/// A compound predicate that is be used to combine multiple predicates using logical operators. #[derive_where(Debug, Eq, PartialEq, Clone; T::Projection)] #[serde_where(T::Projection)] #[derive(Decode, Encode, Deserialize, Serialize, IntoSchema)] pub enum CompoundPredicate> { + /// A predicate as-is Atom(T::Projection), + /// A negation of a compound predicate. Not(Box>), + /// A conjunction of multiple predicates. And(Vec>), + /// A disjunction of multiple predicates. Or(Vec>), } impl> CompoundPredicate { + /// A compound predicate that always evaluates to `true`. pub const PASS: Self = Self::And(Vec::new()); + /// A compound predicate that always evaluates to `false`. + pub const FAIL: Self = Self::Or(Vec::new()); // aliases for logical operations /// Negate the predicate. @@ -49,6 +57,7 @@ where T: HasProjection, T::Projection: EvaluatePredicate, { + /// Evaluate the predicate on the given input. pub fn applies(&self, input: &T) -> bool { match self { CompoundPredicate::Atom(projection) => projection.applies(input), @@ -112,6 +121,7 @@ impl> core::ops::BitOr for CompoundPredicate> CompoundPredicate { + /// Build a new compound predicate using the provided closure. pub fn build(f: F) -> Self where T: HasPrototype, diff --git a/crates/iroha_data_model/src/query/dsl/mod.rs b/crates/iroha_data_model/src/query/dsl/mod.rs index bdb97506dd3..cfd59955030 100644 --- a/crates/iroha_data_model/src/query/dsl/mod.rs +++ b/crates/iroha_data_model/src/query/dsl/mod.rs @@ -1,12 +1,77 @@ -// TODO -#![allow(unused, missing_docs)] +//! This module contains the domain-specific language (DSL) for constructing queries. +//! +//! # Prototypes and Projections +//! +//! Each data type that can be returned from a query (including nested types) has corresponding prototype and projection types. +//! +//! ## Purpose +//! +//! Prototypes exist to allow constructing queries with a type-safe API. +//! They do not get encoded in the query, existing only for the DSL purposes. +//! They are zero-sized objects that mimic the actual data model types by having the same files as them. +//! They allow constructing query predicates and selectors with a type-safe API. +//! +//! Projections are used as part of the representation of predicates and selectors. +//! Projections by themselves are used to select a subfield of the data model type (possibly deeply nested). +//! +//! ## Usage of prototypes +//! +//! The end-user of iroha gets exposed to prototypes when constructing query predicates and selectors. +//! +//! For both of these, they have to provide a function that takes a prototype and returns something representing the predicates or selector they want to construct. +//! +//! For predicates, they have to return the [`CompoundPredicate`] type, which is by itself a predicate. +//! +//! To get this [`CompoundPredicate`] they have to call one of the helper methods on any of the prototypes they've got access to. +//! +//! ```rust +//! # use iroha_data_model::{domain::DomainId, account::AccountId, query::dsl::CompoundPredicate}; +//! let filter_by_domain_name = CompoundPredicate::::build(|account_id| account_id.domain.name.eq("wonderland")); +//! ``` +//! For selectors, they have to return a type implementing the [1IntoSelectorTuple1] trait. +//! +//! It can be either a standalone prototype or a tuple of prototypes. +//! +//! ```rust +//! # use iroha_data_model::{domain::DomainId, account::AccountId, query::dsl::SelectorTuple}; +//! let select_domain_name = SelectorTuple::::build(|account_id| account_id.domain.name); +//! let select_domain_name_and_signatory = +//! SelectorTuple::::build(|account_id| (account_id.domain.name, account_id.signatory)); +//! ``` +//! +//! ## Implementation details +//! +//! Projections types are shared between the filters and selectors by using the [`Projectable`] trait and its marker parameter. +//! For predicates the marker parameter is [`PredicateMarker`], for selectors it is [`SelectorMarker`]. +//! +//! All projections have an `Atom` variant, representing the end of field traversal. +//! They also have variants for each field of the data model type, containing a projection for that field type inside. +//! +//! What is stored in the `Atom` variant is decided by the [`Projectable`] trait implementation for the type. +//! +//! # Object projectors +//! +//! To facilitate conversion of prototypes into actual predicates and selectors, there also exist object projectors implementing the [`ObjectProjector`] trait. +//! +//! They get passed as a type parameter to the prototype and describe the path over the type hierarchy that this particular prototype comes from. +//! An object projector accepts a projection or a selector of a more specific type and returns a projection or a selector of a more general type wrapped in a projection. +//! +//! For example, [`type_descriptions::AccountIdDomainProjector`] accepts a predicate or a selector on [`DomainId`](crate::domain::DomainId) and returns a predicate or a selector on [`AccountId`](crate::account::AccountId) by wrapping it with [`type_descriptions::AccountIdProjection`]. +//! Notice the difference between projector and projection: projector is just zero-sized utility type, while projection is actually a predicate or a selector. +//! +//! A special kind of projector is a [`BaseProjector`]: it does not change the type of the projection, it just returns it as is. +//! It used to terminate the recursion in the projector hierarchy. +//! +//! # Compound predicates and selectors +//! +//! Normally a predicates has just a single condition on a single field. +//! [`CompoundPredicate`] allows composition of multiple predicates using logical operators. +//! This is the type that is actually #[cfg(not(feature = "std"))] use alloc::{format, string::String, vec::Vec}; use core::marker::PhantomData; -use derive_where::derive_where; - mod compound_predicate; pub mod predicates; mod selector_traits; @@ -22,57 +87,80 @@ pub use self::{ }; use crate::query::QueryOutputBatchBox; +/// Trait implemented on all evaluable predicates for type `T`. pub trait EvaluatePredicate { + /// Evaluate the predicate on the given input. fn applies(&self, input: &T) -> bool; } +/// Trait that allows to get the predicate type for a given type. pub trait HasPredicateAtom { + /// The type of the predicate for this type. type Predicate: EvaluatePredicate; } +/// Trait implemented on all evaluable selectors for type `T`. pub trait EvaluateSelector { + /// Select the field from each of the elements in the input and type-erase the result. Cloning version. #[expect(single_use_lifetimes)] // FP, this the suggested change is not allowed on stable fn project_clone<'a>(&self, batch: impl Iterator) -> QueryOutputBatchBox; + /// Select the field from each of the elements in the input and type-erase the result. fn project(&self, batch: impl Iterator) -> QueryOutputBatchBox; } // The IntoSchema derive is only needed for `PredicateMarker` to have `type_name` // the actual value of these types is never encoded +/// A marker type to be used as parameter in the [`Projectable`] trait. This marker is used for predicates. #[derive(IntoSchema)] #[allow(missing_copy_implementations)] pub struct PredicateMarker; +/// A marker type to be used as parameter in the [`Projectable`] trait. This marker is used for selectors. #[derive(IntoSchema)] #[allow(missing_copy_implementations)] pub struct SelectorMarker; +/// A trait implemented on all types that want to get projection implemented on. It is used by the projection implementation to determine the atom type. pub trait Projectable { + /// The type of the atom for this type. Atom gets stored in the projection when this type ends up being the destination of the type hierarchy traversal. type AtomType; } impl Projectable for T { + // Predicate is the atom for predicates type AtomType = T::Predicate; } impl Projectable for T { + // Selectors don't store anything in the atom type AtomType = (); } +/// A trait allowing to get the projection for the type. pub trait HasProjection: Projectable { + /// The type of the projection for this type. type Projection; + /// Construct an atom projection for this type. fn atom(atom: Self::AtomType) -> Self::Projection; } +/// A trait allowing to get the prototype for the type. pub trait HasPrototype { + /// The prototype type for this type. type Prototype: Default + Copy; } +/// Describes how to convert a projection on `InputType` to a projection on `OutputType` by wrapping it in a projection. pub trait ObjectProjector { + /// The type of input projection. type InputType: HasProjection; + /// The type of output projection. type OutputType: HasProjection; + /// Convert the projection on [`Self::InputType`] to a projection on [`Self::OutputType`]. fn project( projection: >::Projection, ) -> >::Projection; + /// Construct a projection from an atom and convert it to a projection on [`Self::OutputType`]. fn wrap_atom( atom: >::AtomType, ) -> >::Projection { @@ -81,6 +169,7 @@ pub trait ObjectProjector { } } +/// An [`ObjectProjector`] that does not change the type, serving as a base case for the recursion. pub struct BaseProjector(PhantomData<(Marker, T)>); impl ObjectProjector for BaseProjector @@ -95,6 +184,7 @@ where } } +/// The prelude re-exports most commonly used traits, structs and macros from this crate. pub mod prelude { pub use super::{ predicates::prelude::*, type_descriptions::prelude::*, CompoundPredicate, SelectorTuple, diff --git a/crates/iroha_data_model/src/query/dsl/predicates.rs b/crates/iroha_data_model/src/query/dsl/predicates.rs index 01f702c2fcf..3a6d9e23895 100644 --- a/crates/iroha_data_model/src/query/dsl/predicates.rs +++ b/crates/iroha_data_model/src/query/dsl/predicates.rs @@ -1,3 +1,5 @@ +//! This module contains predicate definitions for all queryable types. See the [module-level documentation](crate::query::dsl) for more information. + #[cfg(not(feature = "std"))] use alloc::{format, string::String, vec::Vec}; @@ -25,7 +27,7 @@ use crate::{ StringPrototype, TransactionErrorPrototype, TransactionHashPrototype, TriggerIdPrototype, TriggerPrototype, }, - CompoundPredicate, HasPrototype, ObjectProjector, PredicateMarker, + CompoundPredicate, ObjectProjector, PredicateMarker, }, CommittedTransaction, }, @@ -57,7 +59,7 @@ macro_rules! impl_predicate_atom { )* ) => { $( - + #[doc = concat!("At atomic predicate on [`", stringify!($ty_name), "`]")] #[derive( Debug, Clone, PartialEq, Eq, parity_scale_codec::Decode, parity_scale_codec::Encode, serde::Deserialize, serde::Serialize, iroha_schema::IntoSchema @@ -92,6 +94,7 @@ macro_rules! impl_predicate_atom { Projector: ObjectProjector, { $( + $(#[$($variant_attrs)*])* pub fn $constructor_name(self $(, $variant_pat: $variant_ty)?) -> CompoundPredicate { CompoundPredicate::Atom(Projector::wrap_atom( $atom_name::$variant_name$(($variant_pat))? @@ -103,7 +106,8 @@ macro_rules! impl_predicate_atom { }; } -// Defined separately because it needs an `AsRef` generic +/// An atomic predicate on [`String`] or [`Name`] +// Defined separately because it is shared between [String] and [Name] #[derive( Debug, Clone, @@ -157,17 +161,19 @@ impl super::EvaluatePredicate for StringPredicateAtom { } } -// TODO: can we coalesce String and Name prototypes, so these impls wouldn't have to be repeated? I am not sure if it's possible tbh... +// It is unfortunate that we have to repeat the prototype methods on String and Name, but I don't think it's possible to remove this duplication impl StringPrototype where Projection: ObjectProjector, { + /// Checks if the input is equal to the expected value. pub fn eq(self, expected: impl Into) -> CompoundPredicate { CompoundPredicate::Atom(Projection::wrap_atom(StringPredicateAtom::Equals( expected.into(), ))) } + /// Checks if the input contains an expected substring, like [`str::contains()`]. pub fn contains( self, expected: impl Into, @@ -177,6 +183,7 @@ where ))) } + /// Checks if the input starts with an expected substring, like [`str::starts_with()`]. pub fn starts_with( self, expected: impl Into, @@ -186,6 +193,7 @@ where ))) } + /// Checks if the input ends with an expected substring, like [`str::ends_with()`]. pub fn ends_with( self, expected: impl Into, @@ -200,12 +208,14 @@ impl NamePrototype where Projection: ObjectProjector, { + /// Checks if the input is equal to the expected value. pub fn eq(self, expected: impl Into) -> CompoundPredicate { CompoundPredicate::Atom(Projection::wrap_atom(StringPredicateAtom::Equals( expected.into(), ))) } + /// Checks if the input contains an expected substring, like [`str::contains()`]. pub fn contains( self, expected: impl Into, @@ -215,6 +225,7 @@ where ))) } + /// Checks if the input starts with an expected substring, like [`str::starts_with()`]. pub fn starts_with( self, expected: impl Into, @@ -224,6 +235,7 @@ where ))) } + /// Checks if the input ends with an expected substring, like [`str::ends_with()`]. pub fn ends_with( self, expected: impl Into, @@ -235,7 +247,7 @@ where } impl_predicate_atom! { - MetadataPredicateAtom(input: Metadata) [MetadataPrototype] { + MetadataPredicateAtom(_input: Metadata) [MetadataPrototype] { // TODO: populate } PublicKeyPredicateAtom(input: PublicKey) [PublicKeyPrototype] { diff --git a/crates/iroha_data_model/src/query/dsl/selector_traits.rs b/crates/iroha_data_model/src/query/dsl/selector_traits.rs index 146802f30df..7e9e28f9473 100644 --- a/crates/iroha_data_model/src/query/dsl/selector_traits.rs +++ b/crates/iroha_data_model/src/query/dsl/selector_traits.rs @@ -1,20 +1,30 @@ #[cfg(not(feature = "std"))] -use alloc::{vec, vec::Vec}; +use alloc::vec; use crate::{ prelude::SelectorTuple, query::dsl::{HasProjection, SelectorMarker}, }; +/// A trait implemented on all types that can be converted into a selector (usually prototypes). pub trait IntoSelector { + /// A type that the selector is selecting from type SelectingType: HasProjection; + /// A type that the selector ends up selecting + // Note that this type is not exposed by the converted selector + // As such, it is not possible to do type-safe queries just by looking at the selector, a type implementing this trait must be used type SelectedType; + /// Convert the type into a selector fn into_selector(self) -> >::Projection; } +/// A trait implemented on all types that can be converted into a selector tuple (usually prototypes). pub trait IntoSelectorTuple { + /// A type that the selector is selecting from type SelectingType: HasProjection; + /// A tuple of types that the selector ends up selecting type SelectedTuple; + /// Convert the type into a selector tuple fn into_selector_tuple(self) -> SelectorTuple; } diff --git a/crates/iroha_data_model/src/query/dsl/selector_tuple.rs b/crates/iroha_data_model/src/query/dsl/selector_tuple.rs index b56c91eefe9..e6797dbf34e 100644 --- a/crates/iroha_data_model/src/query/dsl/selector_tuple.rs +++ b/crates/iroha_data_model/src/query/dsl/selector_tuple.rs @@ -7,21 +7,38 @@ use iroha_schema::IntoSchema; use parity_scale_codec::{Decode, Encode}; use serde::{Deserialize, Serialize}; -use crate::query::{ - dsl::{HasProjection, SelectorMarker}, - QueryOutputBatchBox, +use crate::query::dsl::{ + BaseProjector, HasProjection, HasPrototype, IntoSelectorTuple, SelectorMarker, }; +/// A tuple of selectors selecting some subfields from `T`. #[derive_where(Debug, Eq, PartialEq, Clone; T::Projection)] #[serde_where(T::Projection)] #[derive(Decode, Encode, Deserialize, Serialize, IntoSchema)] pub struct SelectorTuple>(Vec); impl> SelectorTuple { + /// Create a new selector tuple from a list of selectors. pub fn new(selectors: Vec) -> Self { Self(selectors) } + /// Build a selector tuple using a prototype. + /// + /// Note that unlike predicates, the result of this function cannot be fed into the query builder. + pub fn build(f: F) -> Self + where + T: HasPrototype, + F: FnOnce( + ::Prototype>, + ) -> O, + ::Prototype>: Default, + O: IntoSelectorTuple, + { + f(Default::default()).into_selector_tuple() + } + + /// Iterate over the selectors in the tuple. pub fn iter(&self) -> impl Iterator { self.0.iter() } diff --git a/crates/iroha_data_model/src/query/dsl/type_descriptions.rs b/crates/iroha_data_model/src/query/dsl/type_descriptions.rs index e35e5cfaff9..31d0512eb3d 100644 --- a/crates/iroha_data_model/src/query/dsl/type_descriptions.rs +++ b/crates/iroha_data_model/src/query/dsl/type_descriptions.rs @@ -1,10 +1,10 @@ +//! This module contains definitions of prototypes and projections for the data model types. See the [module-level documentation](crate::query::dsl) for more information. + #[cfg(not(feature = "std"))] use alloc::{format, string::String, vec::Vec}; use derive_where::derive_where; use iroha_crypto::{HashOf, PublicKey}; -use iroha_macro::serde_where; -use serde::{Deserialize, Serialize}; // used in the macro use crate::query::dsl::{ @@ -83,6 +83,7 @@ macro_rules! type_descriptions { // unpack tt sequence back ($($dep_ty_bounds:tt)*) ) => { + #[doc = concat!("A projector on [`", stringify!($ty), "`] for its `", stringify!($field_name), "` field.")] pub struct $projector_name(core::marker::PhantomData<(Marker, Base)>); impl ObjectProjector for $projector_name @@ -129,6 +130,7 @@ macro_rules! type_descriptions { type_descriptions!(@check_attrs $(#[$($attrs)*])*); // hints to the IDE that these are types + #[allow(unused_variables)] const _:() = { let t: $ty; $($(let t: $dep_ty;)+)? @@ -136,6 +138,7 @@ macro_rules! type_descriptions { }; // projection enum + #[doc = concat!("A projection for the [`", stringify!($ty), "`] type.")] // use derive_where to generate trait bounds #[derive_where::derive_where(Debug, Eq, PartialEq, Copy, Clone; <$ty as Projectable>::AtomType @@ -154,8 +157,10 @@ macro_rules! type_descriptions { $ty: Projectable $($(, $dep_ty: HasProjection)*)? { + #[doc = "Finish the projection with an atom."] Atom(<$ty as Projectable>::AtomType), $( + #[doc = concat!("Projection for the `", stringify!($field_name), "` field.")] $proj_variant( <$field_ty as HasProjection>::Projection ), @@ -187,9 +192,12 @@ macro_rules! type_descriptions { )*) ($(, $($dep_ty: Projectable),*)?)); // prototype struct + #[doc = concat!("A prototype for the [`", stringify!($ty), "`] type.")] #[derive_where::derive_where(Default, Copy, Clone)] pub struct $prototype_name { $( + // TODO: I think it might make sense to provide field documentation here. How would we do that without copying the docs to the type description macro though? + #[doc = concat!("Accessor for the `", stringify!($field_name), "` field.")] pub $field_name: <$field_ty as HasPrototype>::Prototype>, )* phantom: core::marker::PhantomData<(Marker, Projector)>, @@ -427,5 +435,6 @@ impl EvaluateSelector for SignedTransactionProjection usize { self.tuple.iter().map(QueryOutputBatchBox::len).sum() } diff --git a/docs/source/references/schema.json b/docs/source/references/schema.json index 375ab8fcc43..2e9f8545cff 100644 --- a/docs/source/references/schema.json +++ b/docs/source/references/schema.json @@ -1,4 +1,5 @@ { + "()": null, "Account": { "Struct": [ { @@ -127,22 +128,50 @@ } ] }, - "AccountIdPredicateBox": { + "AccountIdPredicateAtom": { "Enum": [ { "tag": "Equals", "discriminant": 0, "type": "AccountId" + } + ] + }, + "AccountIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "AccountIdPredicateAtom" }, { - "tag": "DomainId", + "tag": "Domain", + "discriminant": 1, + "type": "DomainIdProjection" + }, + { + "tag": "Signatory", + "discriminant": 2, + "type": "PublicKeyProjection" + } + ] + }, + "AccountIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Domain", "discriminant": 1, - "type": "DomainIdPredicateBox" + "type": "DomainIdProjection" }, { "tag": "Signatory", "discriminant": 2, - "type": "PublicKeyPredicateBox" + "type": "PublicKeyProjection" } ] }, @@ -158,17 +187,44 @@ } ] }, - "AccountPredicateBox": { + "AccountPredicateAtom": { + "Enum": [] + }, + "AccountProjection": { "Enum": [ { - "tag": "Id", + "tag": "Atom", "discriminant": 0, - "type": "AccountIdPredicateBox" + "type": "AccountPredicateAtom" + }, + { + "tag": "Id", + "discriminant": 1, + "type": "AccountIdProjection" }, { "tag": "Metadata", + "discriminant": 2, + "type": "MetadataProjection" + } + ] + }, + "AccountProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Id", "discriminant": 1, - "type": "MetadataPredicateBox" + "type": "AccountIdProjection" + }, + { + "tag": "Metadata", + "discriminant": 2, + "type": "MetadataProjection" } ] }, @@ -388,22 +444,50 @@ } ] }, - "AssetDefinitionIdPredicateBox": { + "AssetDefinitionIdPredicateAtom": { "Enum": [ { "tag": "Equals", "discriminant": 0, "type": "AssetDefinitionId" + } + ] + }, + "AssetDefinitionIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "AssetDefinitionIdPredicateAtom" }, { - "tag": "DomainId", + "tag": "Domain", + "discriminant": 1, + "type": "DomainIdProjection" + }, + { + "tag": "Name", + "discriminant": 2, + "type": "NameProjection" + } + ] + }, + "AssetDefinitionIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Domain", "discriminant": 1, - "type": "DomainIdPredicateBox" + "type": "DomainIdProjection" }, { "tag": "Name", "discriminant": 2, - "type": "StringPredicateBox" + "type": "NameProjection" } ] }, @@ -419,22 +503,44 @@ } ] }, - "AssetDefinitionPredicateBox": { + "AssetDefinitionPredicateAtom": { + "Enum": [] + }, + "AssetDefinitionProjection": { "Enum": [ { - "tag": "Id", + "tag": "Atom", "discriminant": 0, - "type": "AssetDefinitionIdPredicateBox" + "type": "AssetDefinitionPredicateAtom" + }, + { + "tag": "Id", + "discriminant": 1, + "type": "AssetDefinitionIdProjection" }, { "tag": "Metadata", + "discriminant": 2, + "type": "MetadataProjection" + } + ] + }, + "AssetDefinitionProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Id", "discriminant": 1, - "type": "MetadataPredicateBox" + "type": "AssetDefinitionIdProjection" }, { - "tag": "OwnedBy", + "tag": "Metadata", "discriminant": 2, - "type": "AccountIdPredicateBox" + "type": "MetadataProjection" } ] }, @@ -539,36 +645,91 @@ } ] }, - "AssetIdPredicateBox": { + "AssetIdPredicateAtom": { "Enum": [ { "tag": "Equals", "discriminant": 0, "type": "AssetId" + } + ] + }, + "AssetIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "AssetIdPredicateAtom" }, { - "tag": "DefinitionId", + "tag": "Account", "discriminant": 1, - "type": "AssetDefinitionIdPredicateBox" + "type": "AccountIdProjection" }, { - "tag": "AccountId", + "tag": "Definition", "discriminant": 2, - "type": "AccountIdPredicateBox" + "type": "AssetDefinitionIdProjection" } ] }, - "AssetPredicateBox": { + "AssetIdProjection": { "Enum": [ { - "tag": "Id", + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Account", + "discriminant": 1, + "type": "AccountIdProjection" + }, + { + "tag": "Definition", + "discriminant": 2, + "type": "AssetDefinitionIdProjection" + } + ] + }, + "AssetPredicateAtom": { + "Enum": [] + }, + "AssetProjection": { + "Enum": [ + { + "tag": "Atom", "discriminant": 0, - "type": "AssetIdPredicateBox" + "type": "AssetPredicateAtom" + }, + { + "tag": "Id", + "discriminant": 1, + "type": "AssetIdProjection" }, { "tag": "Value", + "discriminant": 2, + "type": "AssetValueProjection" + } + ] + }, + "AssetProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Id", "discriminant": 1, - "type": "AssetValuePredicateBox" + "type": "AssetIdProjection" + }, + { + "tag": "Value", + "discriminant": 2, + "type": "AssetValueProjection" } ] }, @@ -613,9 +774,27 @@ } ] }, - "AssetValuePredicateBox": { + "AssetValuePredicateAtom": { "Enum": [] }, + "AssetValueProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "AssetValuePredicateAtom" + } + ] + }, + "AssetValueProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "BlockEvent": { "Struct": [ { @@ -640,15 +819,6 @@ } ] }, - "BlockHashPredicateBox": { - "Enum": [ - { - "tag": "Equals", - "discriminant": 0, - "type": "HashOf" - } - ] - }, "BlockHeader": { "Struct": [ { @@ -673,12 +843,61 @@ } ] }, - "BlockHeaderPredicateBox": { + "BlockHeaderHashPredicateAtom": { + "Enum": [ + { + "tag": "Equals", + "discriminant": 0, + "type": "HashOf" + } + ] + }, + "BlockHeaderHashProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "BlockHeaderHashPredicateAtom" + } + ] + }, + "BlockHeaderHashProjection": { "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, + "BlockHeaderPredicateAtom": { + "Enum": [] + }, + "BlockHeaderProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "BlockHeaderPredicateAtom" + }, { "tag": "Hash", + "discriminant": 1, + "type": "BlockHeaderHashProjection" + } + ] + }, + "BlockHeaderProjection": { + "Enum": [ + { + "tag": "Atom", "discriminant": 0, - "type": "BlockHashPredicateBox" + "type": "()" + }, + { + "tag": "Hash", + "discriminant": 1, + "type": "BlockHeaderHashProjection" } ] }, @@ -989,22 +1208,54 @@ } ] }, - "CommittedTransactionPredicateBox": { + "CommittedTransactionPredicateAtom": { + "Enum": [] + }, + "CommittedTransactionProjection": { "Enum": [ { - "tag": "BlockHash", + "tag": "Atom", "discriminant": 0, - "type": "BlockHashPredicateBox" + "type": "CommittedTransactionPredicateAtom" }, { - "tag": "Value", + "tag": "BlockHash", "discriminant": 1, - "type": "SignedTransactionPredicateBox" + "type": "BlockHeaderHashProjection" + }, + { + "tag": "Value", + "discriminant": 2, + "type": "SignedTransactionProjection" }, { "tag": "Error", + "discriminant": 3, + "type": "TransactionErrorProjection" + } + ] + }, + "CommittedTransactionProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "BlockHash", + "discriminant": 1, + "type": "BlockHeaderHashProjection" + }, + { + "tag": "Value", "discriminant": 2, - "type": "TransactionErrorPredicateBox" + "type": "SignedTransactionProjection" + }, + { + "tag": "Error", + "discriminant": 3, + "type": "TransactionErrorProjection" } ] }, @@ -1014,315 +1265,315 @@ "Compact": { "Int": "Compact" }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "AccountPredicateBox" + "type": "AccountProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "AssetDefinitionPredicateBox" + "type": "AssetProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "AssetPredicateBox" + "type": "AssetDefinitionProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "BlockHeaderPredicateBox" + "type": "BlockHeaderProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "CommittedTransactionPredicateBox" + "type": "CommittedTransactionProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "DomainPredicateBox" + "type": "DomainProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "PeerPredicateBox" + "type": "PeerIdProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "PermissionPredicateBox" + "type": "PermissionProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "RoleIdPredicateBox" + "type": "RoleProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "RolePredicateBox" + "type": "RoleIdProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "SignedBlockPredicateBox" + "type": "SignedBlockProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "TriggerIdPredicateBox" + "type": "TriggerProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, - "CompoundPredicate": { + "CompoundPredicate": { "Enum": [ { "tag": "Atom", "discriminant": 0, - "type": "TriggerPredicateBox" + "type": "TriggerIdProjection" }, { "tag": "Not", "discriminant": 1, - "type": "CompoundPredicate" + "type": "CompoundPredicate" }, { "tag": "And", "discriminant": 2, - "type": "Vec>" + "type": "Vec>" }, { "tag": "Or", "discriminant": 3, - "type": "Vec>" + "type": "Vec>" } ] }, @@ -1576,17 +1827,40 @@ } ] }, - "DomainIdPredicateBox": { + "DomainIdPredicateAtom": { "Enum": [ { "tag": "Equals", "discriminant": 0, "type": "DomainId" + } + ] + }, + "DomainIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "DomainIdPredicateAtom" }, { "tag": "Name", "discriminant": 1, - "type": "StringPredicateBox" + "type": "NameProjection" + } + ] + }, + "DomainIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Name", + "discriminant": 1, + "type": "NameProjection" } ] }, @@ -1602,17 +1876,44 @@ } ] }, - "DomainPredicateBox": { + "DomainPredicateAtom": { + "Enum": [] + }, + "DomainProjection": { "Enum": [ { - "tag": "Id", + "tag": "Atom", "discriminant": 0, - "type": "DomainIdPredicateBox" + "type": "DomainPredicateAtom" + }, + { + "tag": "Id", + "discriminant": 1, + "type": "DomainIdProjection" }, { "tag": "Metadata", + "discriminant": 2, + "type": "MetadataProjection" + } + ] + }, + "DomainProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Id", "discriminant": 1, - "type": "MetadataPredicateBox" + "type": "DomainIdProjection" + }, + { + "tag": "Metadata", + "discriminant": 2, + "type": "MetadataProjection" } ] }, @@ -2520,9 +2821,27 @@ } ] }, - "MetadataPredicateBox": { + "MetadataPredicateAtom": { "Enum": [] }, + "MetadataProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "MetadataPredicateAtom" + } + ] + }, + "MetadataProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "Mint": { "Struct": [ { @@ -2636,6 +2955,24 @@ ] }, "Name": "String", + "NameProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "StringPredicateAtom" + } + ] + }, + "NameProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "NewAccount": { "Struct": [ { @@ -2923,9 +3260,37 @@ } ] }, - "PeerPredicateBox": { + "PeerIdPredicateAtom": { "Enum": [] }, + "PeerIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "PeerIdPredicateAtom" + }, + { + "tag": "PublicKey", + "discriminant": 1, + "type": "PublicKeyProjection" + } + ] + }, + "PeerIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "PublicKey", + "discriminant": 1, + "type": "PublicKeyProjection" + } + ] + }, "Permission": { "Struct": [ { @@ -2938,9 +3303,27 @@ } ] }, - "PermissionPredicateBox": { + "PermissionPredicateAtom": { "Enum": [] }, + "PermissionProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "PermissionPredicateAtom" + } + ] + }, + "PermissionProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "PipelineEventBox": { "Enum": [ { @@ -2981,7 +3364,7 @@ } ] }, - "PublicKeyPredicateBox": { + "PublicKeyPredicateAtom": { "Enum": [ { "tag": "Equals", @@ -2990,82 +3373,100 @@ } ] }, + "PublicKeyProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "PublicKeyPredicateAtom" + } + ] + }, + "PublicKeyProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "QueryBox": { "Enum": [ { "tag": "FindDomains", "discriminant": 0, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindAccounts", "discriminant": 1, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindAssets", "discriminant": 2, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindAssetsDefinitions", "discriminant": 3, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindRoles", "discriminant": 4, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindRoleIds", "discriminant": 5, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindPermissionsByAccountId", "discriminant": 6, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindRolesByAccountId", "discriminant": 7, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindAccountsWithAsset", "discriminant": 8, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindPeers", "discriminant": 9, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindActiveTriggerIds", "discriminant": 10, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindTriggers", "discriminant": 11, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindTransactions", "discriminant": 12, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindBlocks", "discriminant": 13, - "type": "QueryWithFilter" + "type": "QueryWithFilter" }, { "tag": "FindBlockHeaders", "discriminant": 14, - "type": "QueryWithFilter" + "type": "QueryWithFilter" } ] }, @@ -3111,89 +3512,162 @@ "Struct": [ { "name": "batch", - "type": "QueryOutputBatchBox" + "type": "QueryOutputBatchBoxTuple" }, { "name": "remaining_items", "type": "u64" }, { - "name": "continue_cursor", - "type": "Option" - } - ] - }, - "QueryOutputBatchBox": { - "Enum": [ + "name": "continue_cursor", + "type": "Option" + } + ] + }, + "QueryOutputBatchBox": { + "Enum": [ + { + "tag": "PublicKey", + "discriminant": 0, + "type": "Vec" + }, + { + "tag": "String", + "discriminant": 1, + "type": "Vec" + }, + { + "tag": "Metadata", + "discriminant": 2, + "type": "Vec" + }, + { + "tag": "Name", + "discriminant": 3, + "type": "Vec" + }, + { + "tag": "DomainId", + "discriminant": 4, + "type": "Vec" + }, { "tag": "Domain", - "discriminant": 0, + "discriminant": 5, "type": "Vec" }, + { + "tag": "AccountId", + "discriminant": 6, + "type": "Vec" + }, { "tag": "Account", - "discriminant": 1, + "discriminant": 7, "type": "Vec" }, + { + "tag": "AssetId", + "discriminant": 8, + "type": "Vec" + }, { "tag": "Asset", - "discriminant": 2, + "discriminant": 9, "type": "Vec" }, + { + "tag": "AssetValue", + "discriminant": 10, + "type": "Vec" + }, + { + "tag": "AssetDefinitionId", + "discriminant": 11, + "type": "Vec" + }, { "tag": "AssetDefinition", - "discriminant": 3, + "discriminant": 12, "type": "Vec" }, { "tag": "Role", - "discriminant": 4, + "discriminant": 13, "type": "Vec" }, { "tag": "Parameter", - "discriminant": 5, + "discriminant": 14, "type": "Vec" }, { "tag": "Permission", - "discriminant": 6, + "discriminant": 15, "type": "Vec" }, { - "tag": "Transaction", - "discriminant": 7, + "tag": "CommittedTransaction", + "discriminant": 16, "type": "Vec" }, + { + "tag": "SignedTransaction", + "discriminant": 17, + "type": "Vec" + }, + { + "tag": "TransactionHash", + "discriminant": 18, + "type": "Vec>" + }, + { + "tag": "TransactionRejectionReason", + "discriminant": 19, + "type": "Vec>" + }, { "tag": "Peer", - "discriminant": 8, + "discriminant": 20, "type": "Vec" }, { "tag": "RoleId", - "discriminant": 9, + "discriminant": 21, "type": "Vec" }, { "tag": "TriggerId", - "discriminant": 10, + "discriminant": 22, "type": "Vec" }, { "tag": "Trigger", - "discriminant": 11, + "discriminant": 23, "type": "Vec" }, { "tag": "Block", - "discriminant": 12, + "discriminant": 24, "type": "Vec" }, { "tag": "BlockHeader", - "discriminant": 13, + "discriminant": 25, "type": "Vec" + }, + { + "tag": "BlockHeaderHash", + "discriminant": 26, + "type": "Vec>" + } + ] + }, + "QueryOutputBatchBoxTuple": { + "Struct": [ + { + "name": "tuple", + "type": "Vec" } ] }, @@ -3259,7 +3733,7 @@ ] }, "QuerySignature": "SignatureOf", - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3267,11 +3741,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3279,11 +3757,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3291,11 +3773,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3303,11 +3789,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3315,11 +3805,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3327,11 +3821,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3339,11 +3837,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3351,11 +3853,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3363,11 +3869,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3375,11 +3885,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3387,11 +3901,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3399,11 +3917,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3411,11 +3933,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3423,11 +3949,15 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, - "QueryWithFilter": { + "QueryWithFilter": { "Struct": [ { "name": "query", @@ -3435,7 +3965,11 @@ }, { "name": "predicate", - "type": "CompoundPredicate" + "type": "CompoundPredicate" + }, + { + "name": "selector", + "type": "SelectorTuple" } ] }, @@ -3826,17 +4360,40 @@ } ] }, - "RoleIdPredicateBox": { + "RoleIdPredicateAtom": { "Enum": [ { "tag": "Equals", "discriminant": 0, "type": "RoleId" + } + ] + }, + "RoleIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "RoleIdPredicateAtom" + }, + { + "tag": "Name", + "discriminant": 1, + "type": "NameProjection" + } + ] + }, + "RoleIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" }, { "tag": "Name", "discriminant": 1, - "type": "StringPredicateBox" + "type": "NameProjection" } ] }, @@ -3852,12 +4409,34 @@ } ] }, - "RolePredicateBox": { + "RolePredicateAtom": { + "Enum": [] + }, + "RoleProjection": { "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "RolePredicateAtom" + }, { "tag": "Id", + "discriminant": 1, + "type": "RoleIdProjection" + } + ] + }, + "RoleProjection": { + "Enum": [ + { + "tag": "Atom", "discriminant": 0, - "type": "RoleIdPredicateBox" + "type": "()" + }, + { + "tag": "Id", + "discriminant": 1, + "type": "RoleIdProjection" } ] }, @@ -3873,6 +4452,19 @@ } ] }, + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", + "SelectorTuple": "Vec>", "SetKeyValue": { "Struct": [ { @@ -4003,12 +4595,34 @@ } ] }, - "SignedBlockPredicateBox": { + "SignedBlockPredicateAtom": { + "Enum": [] + }, + "SignedBlockProjection": { "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "SignedBlockPredicateAtom" + }, { "tag": "Header", + "discriminant": 1, + "type": "BlockHeaderProjection" + } + ] + }, + "SignedBlockProjection": { + "Enum": [ + { + "tag": "Atom", "discriminant": 0, - "type": "BlockHeaderPredicateBox" + "type": "()" + }, + { + "tag": "Header", + "discriminant": 1, + "type": "BlockHeaderProjection" } ] }, @@ -4058,17 +4672,44 @@ } ] }, - "SignedTransactionPredicateBox": { + "SignedTransactionPredicateAtom": { + "Enum": [] + }, + "SignedTransactionProjection": { "Enum": [ { - "tag": "Hash", + "tag": "Atom", "discriminant": 0, - "type": "TransactionHashPredicateBox" + "type": "SignedTransactionPredicateAtom" + }, + { + "tag": "Hash", + "discriminant": 1, + "type": "TransactionHashProjection" }, { "tag": "Authority", + "discriminant": 2, + "type": "AccountIdProjection" + } + ] + }, + "SignedTransactionProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + }, + { + "tag": "Hash", "discriminant": 1, - "type": "AccountIdPredicateBox" + "type": "TransactionHashProjection" + }, + { + "tag": "Authority", + "discriminant": 2, + "type": "AccountIdProjection" } ] }, @@ -4232,7 +4873,7 @@ ] }, "String": "String", - "StringPredicateBox": { + "StringPredicateAtom": { "Enum": [ { "tag": "Equals", @@ -4312,7 +4953,7 @@ } ] }, - "TransactionErrorPredicateBox": { + "TransactionErrorPredicateAtom": { "Enum": [ { "tag": "IsSome", @@ -4320,6 +4961,24 @@ } ] }, + "TransactionErrorProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "TransactionErrorPredicateAtom" + } + ] + }, + "TransactionErrorProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "TransactionEvent": { "Struct": [ { @@ -4352,7 +5011,7 @@ } ] }, - "TransactionHashPredicateBox": { + "TransactionHashPredicateAtom": { "Enum": [ { "tag": "Equals", @@ -4361,6 +5020,24 @@ } ] }, + "TransactionHashProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "TransactionHashPredicateAtom" + } + ] + }, + "TransactionHashProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" + } + ] + }, "TransactionLimitError": { "Struct": [ { @@ -4707,17 +5384,40 @@ } ] }, - "TriggerIdPredicateBox": { + "TriggerIdPredicateAtom": { "Enum": [ { "tag": "Equals", "discriminant": 0, "type": "TriggerId" + } + ] + }, + "TriggerIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "TriggerIdPredicateAtom" + }, + { + "tag": "Name", + "discriminant": 1, + "type": "NameProjection" + } + ] + }, + "TriggerIdProjection": { + "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "()" }, { "tag": "Name", "discriminant": 1, - "type": "StringPredicateBox" + "type": "NameProjection" } ] }, @@ -4733,12 +5433,34 @@ } ] }, - "TriggerPredicateBox": { + "TriggerPredicateAtom": { + "Enum": [] + }, + "TriggerProjection": { "Enum": [ + { + "tag": "Atom", + "discriminant": 0, + "type": "TriggerPredicateAtom" + }, { "tag": "Id", + "discriminant": 1, + "type": "TriggerIdProjection" + } + ] + }, + "TriggerProjection": { + "Enum": [ + { + "tag": "Atom", "discriminant": 0, - "type": "TriggerIdPredicateBox" + "type": "()" + }, + { + "tag": "Id", + "discriminant": 1, + "type": "TriggerIdProjection" } ] }, @@ -4889,99 +5611,177 @@ "Vec": { "Vec": "Account" }, + "Vec": { + "Vec": "AccountId" + }, + "Vec>": { + "Vec": "AccountProjection" + }, "Vec": { "Vec": "Asset" }, "Vec": { "Vec": "AssetDefinition" }, + "Vec": { + "Vec": "AssetDefinitionId" + }, + "Vec>": { + "Vec": "AssetDefinitionProjection" + }, + "Vec": { + "Vec": "AssetId" + }, + "Vec>": { + "Vec": "AssetProjection" + }, + "Vec": { + "Vec": "AssetValue" + }, "Vec": { "Vec": "BlockHeader" }, + "Vec>": { + "Vec": "BlockHeaderProjection" + }, "Vec": { "Vec": "BlockSignature" }, "Vec": { "Vec": "CommittedTransaction" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CommittedTransactionProjection" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" }, - "Vec>": { - "Vec": "CompoundPredicate" + "Vec>": { + "Vec": "CompoundPredicate" + }, + "Vec>": { + "Vec": "CompoundPredicate" }, "Vec": { "Vec": "Domain" }, + "Vec": { + "Vec": "DomainId" + }, + "Vec>": { + "Vec": "DomainProjection" + }, "Vec": { "Vec": "EventFilterBox" }, "Vec": { "Vec": "GenesisWasmTrigger" }, + "Vec>": { + "Vec": "HashOf" + }, + "Vec>": { + "Vec": "HashOf" + }, "Vec": { "Vec": "InstructionBox" }, + "Vec": { + "Vec": "Metadata" + }, + "Vec": { + "Vec": "Name" + }, + "Vec>": { + "Vec": "Option" + }, "Vec": { "Vec": "Parameter" }, "Vec": { "Vec": "PeerId" }, + "Vec>": { + "Vec": "PeerIdProjection" + }, "Vec": { "Vec": "Permission" }, + "Vec>": { + "Vec": "PermissionProjection" + }, + "Vec": { + "Vec": "PublicKey" + }, + "Vec": { + "Vec": "QueryOutputBatchBox" + }, "Vec": { "Vec": "Role" }, "Vec": { "Vec": "RoleId" }, + "Vec>": { + "Vec": "RoleIdProjection" + }, + "Vec>": { + "Vec": "RoleProjection" + }, "Vec": { "Vec": "SignedBlock" }, + "Vec>": { + "Vec": "SignedBlockProjection" + }, "Vec": { "Vec": "SignedTransaction" }, + "Vec": { + "Vec": "String" + }, "Vec": { "Vec": "Trigger" }, "Vec": { "Vec": "TriggerId" }, + "Vec>": { + "Vec": "TriggerIdProjection" + }, + "Vec>": { + "Vec": "TriggerProjection" + }, "Vec": { "Vec": "u8" },