You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libindy/src/services/payments.rs
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -206,18 +206,22 @@ impl PaymentsService {
206
206
let inputs:Vec<&str> = serde_json::from_str(inputs).map_err(|_| PaymentsError::CommonError(CommonError::InvalidStructure("Unable to parse inputs".to_string())))?;
207
207
let inputs_len = inputs.len();
208
208
if inputs_len == 0{
209
+
error!("No inputs for transaction");
209
210
returnErr(PaymentsError::CommonError(CommonError::InvalidStructure("No inputs for transaction".to_string())));
210
211
}
211
212
let input_set:HashSet<&str> = inputs.into_iter().collect();
let input_methods:Vec<Option<String>> = input_set.into_iter().map(|s| self._parse_method_from_payment_address(s)).collect();
216
218
if input_methods.contains(&None){
219
+
error!("Some payment addresses are incorrectly formed");
217
220
returnErr(PaymentsError::CommonError(CommonError::InvalidStructure("Some payment addresses are incorrectly formed".to_string())));
218
221
}
219
222
let input_methods_set:HashSet<String> = input_methods.into_iter().map(|s| s.unwrap()).collect();
220
223
if input_methods_set.len() != 1{
224
+
error!("Unable to identify payment method from inputs");
221
225
returnErr(PaymentsError::IncompatiblePaymentError("Unable to identify payment method from inputs".to_string()));
222
226
}
223
227
Ok(input_methods_set.into_iter().next().unwrap())
@@ -227,21 +231,25 @@ impl PaymentsService {
227
231
let outputs:Vec<Output> = serde_json::from_str(outputs).map_err(|_| PaymentsError::CommonError(CommonError::InvalidStructure("Unable to parse outputs".to_string())))?;
228
232
let outputs_len = outputs.len();
229
233
if outputs_len == 0{
234
+
error!("No outputs for transaction");
230
235
returnErr(PaymentsError::CommonError(CommonError::InvalidStructure("No outputs for transaction".to_string())));
231
236
}
232
237
233
238
let payment_address_set:HashSet<String> = outputs.into_iter().map(|s| s.payment_address).collect();
0 commit comments