Skip to content

Commit 23a6aca

Browse files
authored
Merge branch 'master' into patch-1
2 parents d8d80e6 + 3617ead commit 23a6aca

File tree

16 files changed

+2273
-232
lines changed

16 files changed

+2273
-232
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
All encryption is performed in libindy. It simplifies plugged wallets and provides warranty of a good security level
99
for 3d party wallets implementations.
1010
* The format of wallet data was changed for better security and support of efficient search
11-
* Added [Wallet Export/Import API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/009-wallet-export-import) and
11+
* Added EXPERIMENTAL [Wallet Export/Import API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/009-wallet-export-import) and
1212
corresponded commands to Indy CLI
13+
* ```indy_list_wallets``` endpoint is DEPRECATED and will be removed in the next release. The main idea is avoid
14+
maintaining created wallet list on libindy side. It will allow to access wallets from a cluster and solve
15+
some problems on mobile platforms. ```indy_create_wallet``` and ```indy_open_wallet``` endpoints will
16+
also get related changes in the next release.
1317
* Added [Non-Secrets API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/003-wallet-storage#non-secrets-api) that allows store and read
1418
application specific data in the wallet
15-
* Added [Generic Payments API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/004-payment-interface#payment-method-api) that provides
19+
* Added EXPERIMENTAL [Generic Payments API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/004-payment-interface#payment-method-api) that provides
1620
ability to register custom payment method
1721
and then create payment addresses, build payment-related transactions, assign fees to transactions
1822
* Added ability to [load custom plugins using Indy CLI](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/006-cli-plugins)

doc/migration-guide-1.4.0-1.5.0.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ Functions from older version are listed in the left column, and the equivalent n
3939
for 3d party wallets implementations.
4040
* Libindy v1.5 changes wallet format to allow efficient and flexible search for entities with pagination support.
4141
*WARNING* wallet format of libindy v1.5 isn't compatible with a wallet format of libindy v1.4.
42-
* There have been added functions that allow performing Export/Import of Wallet.
42+
* There have been added functions that allow performing Export/Import of Wallet. Note these endpoints are EXPERIMENTAL.
43+
Function signature and behavior may change in the future releases.
44+
* ```indy_list_wallets``` endpoint is DEPRECATED and will be removed in the next release. The main idea is avoid
45+
maintaining created wallet list on libindy side. It will allow to access wallets from a cluster and solve
46+
some problems on mobile platforms. ```indy_create_wallet``` and ```indy_open_wallet``` endpoints will
47+
also get related changes in the next release.
4348

4449
References:
4550

@@ -480,6 +485,9 @@ This API is intended to provide the ability to register custom payment method an
480485
* Adding fees to transactions
481486
* Getting transactions fees amount
482487

488+
Note all endpoints in this group are EXPERIMENTAL. Function signatures and behavior may change
489+
in the future releases.
490+
483491
References:
484492

485493
* [Payment Interface Design](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/004-payment-interface)

libindy/debian/changelog

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ libindy (1.5.0) unstable; urgency=medium
88
All encryption is performed in libindy. It simplifies plugged wallets and provides warranty of a good security level
99
for 3d party wallets implementations.
1010
* The format of wallet data was changed for better security and support of efficient search
11-
* Added [Wallet Export/Import API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/009-wallet-export-import) and
11+
* Added EXPERIMENTAL [Wallet Export/Import API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/009-wallet-export-import) and
1212
corresponded commands to Indy CLI
13+
* ```indy_list_wallets``` endpoint is DEPRECATED and will be removed in the next release. The main idea is avoid
14+
maintaining created wallet list on libindy side. It will allow to access wallets from a cluster and solve
15+
some problems on mobile platforms. ```indy_create_wallet``` and ```indy_open_wallet``` endpoints will
16+
also get related changes in the next release.
1317
* Added [Non-Secrets API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/003-wallet-storage#non-secrets-api) that allows store and read
1418
application specific data in the wallet
15-
* Added [Generic Payments API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/004-payment-interface#payment-method-api) that provides
19+
* Added EXPERIMENTAL [Generic Payments API](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/004-payment-interface#payment-method-api) that provides
1620
ability to register custom payment method
1721
and then create payment addresses, build payment-related transactions, assign fees to transactions
1822
* Added ability to [load custom plugins using Indy CLI](https://github.com/hyperledger/indy-sdk/tree/master/doc/design/006-cli-plugins)

libindy/src/api/payments.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ pub type ParseGetTxnFeesResponseCB = extern fn(command_handle: i32,
265265
///
266266
/// It allows library user to provide custom payment method implementation as set of handlers.
267267
///
268+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
269+
/// in the future releases.
270+
///
268271
/// #Params
269272
/// command_handle: Command handle to map callback to caller context.
270273
/// payment_method: The type of payment method also used as sub-prefix for fully resolvable payment address format ("sov" - for example)
@@ -352,6 +355,9 @@ pub extern fn indy_register_payment_method(command_handle: i32,
352355
/// Note that payment method should be able to resolve this
353356
/// secret by fully resolvable payment address format.
354357
///
358+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
359+
/// in the future releases.
360+
///
355361
/// #Params
356362
/// command_handle: command handle to map callback to context
357363
/// wallet_handle: wallet handle where to save new address
@@ -403,6 +409,9 @@ pub extern fn indy_create_payment_address(command_handle: i32,
403409

404410
/// Lists all payment addresses that are stored in the wallet
405411
///
412+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
413+
/// in the future releases.
414+
///
406415
/// #Params
407416
/// command_handle: command handle to map callback to context
408417
/// wallet_handle: wallet to search for payment_addresses in
@@ -454,6 +463,9 @@ pub extern fn indy_list_payment_addresses(command_handle: i32,
454463
/// Format of inputs is specific for payment method. Usually it should reference payment transaction
455464
/// with at least one output that corresponds to payment address that user owns.
456465
///
466+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
467+
/// in the future releases.
468+
///
457469
/// #Params
458470
/// wallet_handle: wallet handle
459471
/// submitter_did : DID of request sender
@@ -520,6 +532,9 @@ pub extern fn indy_add_request_fees(command_handle: i32,
520532

521533
/// Parses response for Indy request with fees.
522534
///
535+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
536+
/// in the future releases.
537+
///
523538
/// #Params
524539
/// command_handle
525540
/// payment_method
@@ -568,6 +583,9 @@ pub extern fn indy_parse_response_with_fees(command_handle: i32,
568583
/// Builds Indy request for getting UTXO list for payment address
569584
/// according to this payment method.
570585
///
586+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
587+
/// in the future releases.
588+
///
571589
/// #Params
572590
/// wallet_handle: wallet handle
573591
/// submitter_did : DID of request sender
@@ -617,6 +635,9 @@ pub extern fn indy_build_get_utxo_request(command_handle: i32,
617635

618636
/// Parses response for Indy request for getting UTXO list.
619637
///
638+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
639+
/// in the future releases.
640+
///
620641
/// #Params
621642
/// resp_json: response for Indy request for getting UTXO list
622643
/// Note: this param will be used to determine payment_method
@@ -671,6 +692,9 @@ pub extern fn indy_parse_get_utxo_response(command_handle: i32,
671692
/// Format of inputs is specific for payment method. Usually it should reference payment transaction
672693
/// with at least one output that corresponds to payment address that user owns.
673694
///
695+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
696+
/// in the future releases.
697+
///
674698
/// #Params
675699
/// wallet_handle: wallet handle
676700
/// submitter_did : DID of request sender
@@ -731,6 +755,9 @@ pub extern fn indy_build_payment_req(command_handle: i32,
731755

732756
/// Parses response for Indy request for payment txn.
733757
///
758+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
759+
/// in the future releases.
760+
///
734761
/// #Params
735762
/// command_handle
736763
/// payment_method
@@ -782,6 +809,9 @@ pub extern fn indy_parse_payment_response(command_handle: i32,
782809
/// Builds Indy request for doing tokens minting
783810
/// according to this payment method.
784811
///
812+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
813+
/// in the future releases.
814+
///
785815
/// #Params
786816
/// wallet_handle: wallet handle
787817
/// submitter_did : DID of request sender
@@ -836,6 +866,9 @@ pub extern fn indy_build_mint_req(command_handle: i32,
836866

837867
/// Builds Indy request for setting fees for transactions in the ledger
838868
///
869+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
870+
/// in the future releases.
871+
///
839872
/// # Params
840873
/// command_handle
841874
/// wallet_handle: wallet handle
@@ -891,6 +924,9 @@ pub extern fn indy_build_set_txn_fees_req(command_handle: i32,
891924

892925
/// Builds Indy get request for getting fees for transactions in the ledger
893926
///
927+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
928+
/// in the future releases.
929+
///
894930
/// # Params
895931
/// command_handle
896932
/// wallet_handle: wallet handle
@@ -938,6 +974,9 @@ pub extern fn indy_build_get_txn_fees_req(command_handle: i32,
938974

939975
/// Parses response for Indy request for getting fees
940976
///
977+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
978+
/// in the future releases.
979+
///
941980
/// # Params
942981
/// command_handle
943982
/// payment_method

libindy/src/api/wallet.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ pub extern fn indy_open_wallet(command_handle: i32,
270270

271271
/// Lists created wallets as JSON array with each wallet metadata: name, type, name of associated pool
272272
///
273+
/// Note this function is DEPRECATED and will be removed in the next release.
274+
///
273275
/// #Returns
274276
/// wallets list json: [{
275277
/// "name": <string>
@@ -310,6 +312,9 @@ pub extern fn indy_list_wallets(command_handle: i32,
310312

311313
/// Exports opened wallet
312314
///
315+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
316+
/// in the future releases.
317+
///
313318
/// #Params:
314319
/// wallet_handle: wallet handle returned by indy_open_wallet
315320
/// export_config_json: JSON containing settings for input operation.
@@ -356,15 +361,18 @@ pub extern fn indy_export_wallet(command_handle: i32,
356361
}
357362

358363

359-
// Creates a new secure wallet with the given unique name and then imports its content
360-
// according to fields provided in import_config
361-
// This can be seen as an indy_create_wallet call with additional content import
362-
//
363-
// #Params
364-
// pool_name: Name of the pool that corresponds to this wallet
365-
// name: Name of the wallet
366-
// storage_type(optional): Type of the wallet storage. Defaults to 'default'.
367-
// Custom storage types can be registered with indy_register_wallet_storage_call
364+
/// Creates a new secure wallet with the given unique name and then imports its content
365+
/// according to fields provided in import_config
366+
/// This can be seen as an indy_create_wallet call with additional content import
367+
///
368+
/// Note this endpoint is EXPERIMENTAL. Function signature and behaviour may change
369+
/// in the future releases.
370+
///
371+
/// #Params
372+
/// pool_name: Name of the pool that corresponds to this wallet
373+
/// name: Name of the wallet
374+
/// storage_type(optional): Type of the wallet storage. Defaults to 'default'.
375+
/// Custom storage types can be registered with indy_register_wallet_storage_call
368376
/// config(optional): Wallet configuration json.
369377
/// {
370378
/// "storage": <object> List of supported keys are defined by wallet type.

libindy/src/errors/common.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ impl fmt::Display for CommonError {
5454
CommonError::InvalidParam2(ref description) => write!(f, "Invalid param 2: {}", description),
5555
CommonError::InvalidParam3(ref description) => write!(f, "Invalid param 3: {}", description),
5656
CommonError::InvalidParam4(ref description) => write!(f, "Invalid param 4: {}", description),
57-
CommonError::InvalidParam5(ref description) => write!(f, "Invalid param 4: {}", description),
58-
CommonError::InvalidParam6(ref description) => write!(f, "Invalid param 4: {}", description),
59-
CommonError::InvalidParam7(ref description) => write!(f, "Invalid param 4: {}", description),
60-
CommonError::InvalidParam8(ref description) => write!(f, "Invalid param 4: {}", description),
61-
CommonError::InvalidParam9(ref description) => write!(f, "Invalid param 4: {}", description),
57+
CommonError::InvalidParam5(ref description) => write!(f, "Invalid param 5: {}", description),
58+
CommonError::InvalidParam6(ref description) => write!(f, "Invalid param 6: {}", description),
59+
CommonError::InvalidParam7(ref description) => write!(f, "Invalid param 7: {}", description),
60+
CommonError::InvalidParam8(ref description) => write!(f, "Invalid param 8: {}", description),
61+
CommonError::InvalidParam9(ref description) => write!(f, "Invalid param 9: {}", description),
6262
CommonError::InvalidState(ref description) => write!(f, "Invalid library state: {}", description),
6363
CommonError::InvalidStructure(ref description) => write!(f, "Invalid structure: {}", description),
6464
CommonError::IOError(ref err) => err.fmt(f)

libindy/src/services/pool/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl PoolWorker {
164164

165165
let gen_tnxs = PoolWorker::_build_node_state(&merkle_tree)?;
166166

167-
for (_, gen_txn) in &gen_tnxs {
167+
for gen_txn in gen_tnxs.values() {
168168
let mut rn: RemoteNode = match RemoteNode::new(&gen_txn) {
169169
Ok(rn) => rn,
170170
Err(err) => {

libindy/src/services/pool/transaction_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl TransactionHandler {
262262
"Can't flash all transaction requests with common success status".to_string())));
263263
}
264264
Err(_) => {
265-
for (_, pending_cmd) in &mut self.pending_commands {
265+
for pending_cmd in self.pending_commands.values_mut() {
266266
pending_cmd.terminate_parent_cmds(false)?
267267
}
268268
Ok(())
@@ -652,7 +652,7 @@ impl TransactionHandler {
652652
self.pending_commands.remove(&cmd);
653653
}
654654

655-
for (_, pc) in &mut self.pending_commands {
655+
for pc in self.pending_commands.values_mut() {
656656
let is_timeout = pc.resendable_request.as_ref()
657657
.and_then(|resend| resend.next_try_send_time)
658658
.map(|next_try_send_time| next_try_send_time <= time::now_utc())

0 commit comments

Comments
 (0)