@@ -168,23 +168,28 @@ impl From<ProtocolError> for JsonReply {
168168#[ error( transparent) ]
169169pub struct SessionError ( #[ from] receive:: v2:: SessionError ) ;
170170
171+ /// Protocol error raised during output substitution.
172+ #[ derive( Debug , thiserror:: Error , uniffi:: Object ) ]
173+ #[ error( transparent) ]
174+ pub struct OutputSubstitutionProtocolError ( #[ from] receive:: OutputSubstitutionError ) ;
175+
171176/// Error that may occur when output substitution fails.
172177#[ derive( Debug , thiserror:: Error , uniffi:: Error ) ]
173178pub enum OutputSubstitutionError {
174179 #[ error( transparent) ]
175- Protocol ( Arc < receive :: OutputSubstitutionError > ) ,
180+ Protocol ( Arc < OutputSubstitutionProtocolError > ) ,
176181 #[ error( transparent) ]
177- Primitive ( Arc < PrimitiveError > ) ,
182+ Primitive ( PrimitiveError ) ,
178183}
179184
180185impl From < receive:: OutputSubstitutionError > for OutputSubstitutionError {
181186 fn from ( value : receive:: OutputSubstitutionError ) -> Self {
182- OutputSubstitutionError :: Protocol ( Arc :: new ( value) )
187+ OutputSubstitutionError :: Protocol ( Arc :: new ( value. into ( ) ) )
183188 }
184189}
185190
186191impl From < PrimitiveError > for OutputSubstitutionError {
187- fn from ( value : PrimitiveError ) -> Self { OutputSubstitutionError :: Primitive ( Arc :: new ( value) ) }
192+ fn from ( value : PrimitiveError ) -> Self { OutputSubstitutionError :: Primitive ( value) }
188193}
189194
190195/// Error that may occur when coin selection fails.
@@ -213,7 +218,7 @@ pub enum InputPairError {
213218 InvalidPsbtInput ( Arc < PsbtInputError > ) ,
214219 /// Primitive input failed validation in the FFI layer.
215220 #[ error( "Invalid primitive input: {0}" ) ]
216- InvalidPrimitive ( Arc < PrimitiveError > ) ,
221+ InvalidPrimitive ( PrimitiveError ) ,
217222}
218223
219224impl InputPairError {
@@ -223,9 +228,7 @@ impl InputPairError {
223228}
224229
225230impl From < PrimitiveError > for InputPairError {
226- fn from ( value : PrimitiveError ) -> Self {
227- InputPairError :: InvalidPrimitive ( Arc :: new ( value) )
228- }
231+ fn from ( value : PrimitiveError ) -> Self { InputPairError :: InvalidPrimitive ( value) }
229232}
230233
231234/// Error that may occur when a receiver event log is replayed
0 commit comments