Skip to content
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

subxt: Derive std::cmp traits for subxt payloads and addresses #1429

Merged
merged 9 commits into from
Feb 13, 2024
Next Next commit
subxt/tx: Derive std::cmp traits
Signed-off-by: Alexandru Vasile <[email protected]>
lexnv committed Feb 12, 2024
commit 98c9ab754a4f698803731f63de63055e63d8d629
11 changes: 10 additions & 1 deletion subxt/src/tx/tx_payload.rs
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ use crate::{
metadata::Metadata,
};
use codec::Encode;
use derivative::Derivative;
use scale_encode::EncodeAsFields;
use scale_value::{Composite, ValueDef, Variant};
use std::{borrow::Cow, sync::Arc};
@@ -48,7 +49,15 @@ pub struct ValidationDetails<'a> {
}

/// A transaction payload containing some generic `CallData`.
#[derive(Clone, Debug)]
#[derive(Derivative)]
#[derivative(
Clone(bound = "CallData: Clone"),
Debug(bound = "CallData: std::fmt::Debug"),
Eq(bound = "CallData: std::cmp::Eq"),
Ord(bound = "CallData: std::cmp::Ord"),
PartialEq(bound = "CallData: std::cmp::PartialEq"),
PartialOrd(bound = "CallData: std::cmp::PartialOrd")
)]
pub struct Payload<CallData> {
pallet_name: Cow<'static, str>,
call_name: Cow<'static, str>,