@@ -125,6 +125,44 @@ impl AbortReason {
125125impl Display for AbortReason {
126126 fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
127127 match self {
128+ AbortReason :: InvalidStateTransition => f. write_str ( "State transition was invalid" ) ,
129+ AbortReason :: UnexpectedCounterpartyMessage => f. write_str ( "Unexpected message" ) ,
130+ AbortReason :: ReceivedTooManyTxAddInputs => {
131+ f. write_str ( "Too many `tx_add_input`s received" )
132+ } ,
133+ AbortReason :: ReceivedTooManyTxAddOutputs => {
134+ f. write_str ( "Too many `tx_add_output`s received" )
135+ } ,
136+ AbortReason :: IncorrectInputSequenceValue => {
137+ f. write_str ( "Input has a sequence value greater than 0xFFFFFFFD" )
138+ } ,
139+ AbortReason :: IncorrectSerialIdParity => {
140+ f. write_str ( "Parity for `serial_id` was incorrect" )
141+ } ,
142+ AbortReason :: SerialIdUnknown => f. write_str ( "The `serial_id` is unknown" ) ,
143+ AbortReason :: DuplicateSerialId => f. write_str ( "The `serial_id` already exists" ) ,
144+ AbortReason :: PrevTxOutInvalid => f. write_str ( "Invalid previous transaction output" ) ,
145+ AbortReason :: ExceededMaximumSatsAllowed => {
146+ f. write_str ( "Output amount exceeded total bitcoin supply" )
147+ } ,
148+ AbortReason :: ExceededNumberOfInputsOrOutputs => {
149+ f. write_str ( "Too many inputs or outputs" )
150+ } ,
151+ AbortReason :: TransactionTooLarge => f. write_str ( "Transaction weight is too large" ) ,
152+ AbortReason :: BelowDustLimit => f. write_str ( "Output amount is below the dust limit" ) ,
153+ AbortReason :: InvalidOutputScript => f. write_str ( "The output script is non-standard" ) ,
154+ AbortReason :: InsufficientFees => f. write_str ( "Insufficient fees paid" ) ,
155+ AbortReason :: OutputsValueExceedsInputsValue => {
156+ f. write_str ( "Total value of outputs exceeds total value of inputs" )
157+ } ,
158+ AbortReason :: InvalidTx => f. write_str ( "The transaction is invalid" ) ,
159+ AbortReason :: MissingFundingOutput => f. write_str ( "No shared funding output found" ) ,
160+ AbortReason :: DuplicateFundingOutput => {
161+ f. write_str ( "More than one funding output found" )
162+ } ,
163+ AbortReason :: InvalidLowFundingOutputValue => f. write_str (
164+ "Local part of funding output value is greater than the funding output value" ,
165+ ) ,
128166 AbortReason :: ProvidedInputsAndPrevtxsTxIdMismatch ( idx) => f. write_fmt ( format_args ! (
129167 "TxId mismatch in the provided inputs and previous transactions, input index {}" ,
130168 idx
@@ -133,40 +171,9 @@ impl Display for AbortReason {
133171 "Vout provided in an input is not found in the previous transaction, input index {}" ,
134172 idx
135173 ) ) ,
136- _ => f. write_str ( & match self {
137- AbortReason :: InvalidStateTransition => "State transition was invalid" ,
138- AbortReason :: UnexpectedCounterpartyMessage => "Unexpected message" ,
139- AbortReason :: ReceivedTooManyTxAddInputs => "Too many `tx_add_input`s received" ,
140- AbortReason :: ReceivedTooManyTxAddOutputs => "Too many `tx_add_output`s received" ,
141- AbortReason :: IncorrectInputSequenceValue => {
142- "Input has a sequence value greater than 0xFFFFFFFD" . into ( )
143- } ,
144- AbortReason :: IncorrectSerialIdParity => "Parity for `serial_id` was incorrect" ,
145- AbortReason :: SerialIdUnknown => "The `serial_id` is unknown" ,
146- AbortReason :: DuplicateSerialId => "The `serial_id` already exists" ,
147- AbortReason :: PrevTxOutInvalid => "Invalid previous transaction output" ,
148- AbortReason :: ExceededMaximumSatsAllowed => {
149- "Output amount exceeded total bitcoin supply" . into ( )
150- } ,
151- AbortReason :: ExceededNumberOfInputsOrOutputs => "Too many inputs or outputs" ,
152- AbortReason :: TransactionTooLarge => "Transaction weight is too large" ,
153- AbortReason :: BelowDustLimit => "Output amount is below the dust limit" ,
154- AbortReason :: InvalidOutputScript => "The output script is non-standard" ,
155- AbortReason :: InsufficientFees => "Insufficient fees paid" ,
156- AbortReason :: OutputsValueExceedsInputsValue => {
157- "Total value of outputs exceeds total value of inputs" . into ( )
158- } ,
159- AbortReason :: InvalidTx => "The transaction is invalid" ,
160- AbortReason :: MissingFundingOutput => "No shared funding output found" ,
161- AbortReason :: DuplicateFundingOutput => "More than one funding output found" ,
162- AbortReason :: InvalidLowFundingOutputValue => {
163- "Local part of funding output value is greater than the funding output value"
164- } ,
165- AbortReason :: InternalErrorGettingDestinationScript => {
166- "Internal error getting destination script"
167- } ,
168- _ => unreachable ! ( ) ,
169- } ) ,
174+ AbortReason :: InternalErrorGettingDestinationScript => {
175+ f. write_str ( "Internal error getting destination script" )
176+ } ,
170177 }
171178 }
172179}
0 commit comments