Skip to content

Commit

Permalink
added builder to txinitvalidator
Browse files Browse the repository at this point in the history
  • Loading branch information
bengtlofgren committed Nov 10, 2023
1 parent 84bc617 commit 8ee5f00
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sdk/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ impl TxInitAccount {
}
}

/// Transaction to initialize a new account
/// Transaction to initialize a new validator account
#[derive(Clone, Debug)]
pub struct TxInitValidator<C: NamadaTypes = SdkTypes> {
/// Common tx arguments
Expand Down Expand Up @@ -754,6 +754,18 @@ pub struct TxInitValidator<C: NamadaTypes = SdkTypes> {
pub unsafe_dont_encrypt: bool,
}

impl<C: NamadaTypes> TxBuilder<C> for TxInitValidator <C> {
fn tx<F>(self, func: F) -> Self
where
F: FnOnce(Tx<C>) -> Tx<C>,
{
TxInitValidator {
tx: func(self.tx),
..self
}
}
}

/// Transaction to update a VP arguments
#[derive(Clone, Debug)]
pub struct TxUpdateAccount<C: NamadaTypes = SdkTypes> {
Expand Down

0 comments on commit 8ee5f00

Please sign in to comment.