We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
STObjectType
not 100% sure if these will work but rough ideas (I prefer 2 because of the nicer syntax)
use tuple as the field inner type, see: https://crates.io/crates/impl-trait-for-tuples
#[derive(Field, Debug, Clone)] pub struct SignerEntry(pub (Account, SignerWeight)) use impl_for_tuples::impl_for_tuples; // support field objects with upto 5 items #[impl_for_tuples(5)] impl BinarySerialize for TupleIdentifier { fn binary_serialize_to(buf, for_signing) { for_tuples!( #( TupleIdentifier.binary_serialize_to(buf, for_signing) )* ); } } #[impl_for_tuples(5)] impl CodecField for TupleIdentifier { fn field_code(&self) -> u16 { for_tuples!( #( TupleIdentifier.field_code() )* ); } fn type_code(&self) -> u16 { for_tuples!( #( TupleIdentifier.type_code() )* ); } fn is_variable_length(&self) -> bool { for_tuples!( #( TupleIdentifier.is_variable_length() )* ); } fn is_serialized(&self) -> bool { for_tuples!( #( TupleIdentifier.is_serialized() )* ); } fn is_signing_field(&self) -> bool { for_tuples!( #( TupleIdentifier.is_signing_field() )* ); } fn inner(&self) -> &dyn BinarySerialize { for_tuples!( #( TupleIdentifier.inner() )* ); } }
Transaction is basically STObject only missing the Field trait
Transaction
Field
// this will behave as an 'STObject' #[derive(Field, STObject, Debug, Clone)] pub struct SignerEntry { account: Account, weight: SignerWeight }
CodecToFields
change the serialize for Field to do this instead:
xrpl-tx-codec/codec/src/field.rs
Line 93 in 6765c85
for f in &self.to_canonical_fields() { f.binary_serialize_to(buf, for_signing) }
Originally posted by @jordy25519 in #5 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Idea 1
use tuple as the field inner type, see: https://crates.io/crates/impl-trait-for-tuples
Idea 2
Transaction
is basically STObject only missing theField
traitCodecToFields
forField
(macro might needs some changes to parse the above syntax)change the serialize for
Field
to do this instead:xrpl-tx-codec/codec/src/field.rs
Line 93 in 6765c85
Originally posted by @jordy25519 in #5 (comment)
The text was updated successfully, but these errors were encountered: