diff --git a/radicle/src/cob/store.rs b/radicle/src/cob/store.rs index 058f92b8..791e8bae 100644 --- a/radicle/src/cob/store.rs +++ b/radicle/src/cob/store.rs @@ -314,20 +314,23 @@ where T: Cob + cob::Evaluate, { /// Create a new transaction to be used as the initial set of operations for a COB. - pub fn initial( + pub fn initial( message: &str, store: &mut Store, signer: &G, operations: F, ) -> Result<(ObjectId, T), Error> where + Tx: From, + Self: From, G: Signer, - F: FnOnce(&mut Self, &R) -> Result<(), Error>, + F: FnOnce(&mut Tx, &R) -> Result<(), Error>, R: ReadRepository + SignRepository + cob::Store, T::Action: Serialize + Clone, { - let mut tx = Transaction::default(); + let mut tx = Tx::from(Transaction::default()); operations(&mut tx, store.as_ref())?; + let tx = Self::from(tx); let actions = NonEmpty::from_vec(tx.actions) .expect("Transaction::initial: transaction must contain at least one action");