Skip to content

Commit ac3a94e

Browse files
authored
Merge pull request hyperledger-indy#823 from dhh1128/credentials-param
Rename 'credentials' param for clarity
2 parents 2e2b34c + f7b38ca commit ac3a94e

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

libindy/src/api/wallet.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub extern fn indy_register_wallet_storage(command_handle: i32,
150150
/// {
151151
/// "storage": <object> List of supported keys are defined by wallet type.
152152
/// }
153-
/// credentials: Wallet credentials json (if NULL, then default config will be used).
153+
/// credentials_json: Wallet credentials json (if NULL, then default config will be used).
154154
/// {
155155
/// "key": string,
156156
/// "rekey": Optional<string>,
@@ -170,29 +170,29 @@ pub extern fn indy_create_wallet(command_handle: i32,
170170
name: *const c_char,
171171
storage_type: *const c_char,
172172
config: *const c_char,
173-
credentials: *const c_char,
173+
credentials_json: *const c_char,
174174
cb: Option<extern fn(xcommand_handle: i32,
175175
err: ErrorCode)>) -> ErrorCode {
176-
trace!("indy_create_wallet: >>> pool_name: {:?}, name: {:?}, storage_type: {:?}, config: {:?}, credentials: {:?}",
177-
pool_name, name, storage_type, config, credentials);
176+
trace!("indy_create_wallet: >>> pool_name: {:?}, name: {:?}, storage_type: {:?}, config: {:?}, credentials_json: {:?}",
177+
pool_name, name, storage_type, config, credentials_json);
178178

179179
check_useful_c_str!(pool_name, ErrorCode::CommonInvalidParam2);
180180
check_useful_c_str!(name, ErrorCode::CommonInvalidParam3);
181181
check_useful_opt_c_str!(storage_type, ErrorCode::CommonInvalidParam4);
182182
check_useful_opt_c_str!(config, ErrorCode::CommonInvalidParam5);
183-
check_useful_c_str!(credentials, ErrorCode::CommonInvalidParam6);
183+
check_useful_c_str!(credentials_json, ErrorCode::CommonInvalidParam6);
184184
check_useful_c_callback!(cb, ErrorCode::CommonInvalidParam7);
185185

186-
trace!("indy_create_wallet: entities >>> pool_name: {:?}, name: {:?}, storage_type: {:?}, config: {:?}, credentials: {:?}",
187-
pool_name, name, storage_type, config, credentials);
186+
trace!("indy_create_wallet: entities >>> pool_name: {:?}, name: {:?}, storage_type: {:?}, config: {:?}, credentials_json: {:?}",
187+
pool_name, name, storage_type, config, credentials_json);
188188

189189
let result = CommandExecutor::instance()
190190
.send(Command::Wallet(WalletCommand::Create(
191191
pool_name,
192192
name,
193193
storage_type,
194194
config,
195-
credentials,
195+
credentials_json,
196196
Box::new(move |result| {
197197
let err = result_to_err_code!(result);
198198
trace!("indy_create_wallet:");
@@ -218,7 +218,7 @@ pub extern fn indy_create_wallet(command_handle: i32,
218218
/// {
219219
/// "storage": Optional<object> List of supported keys are defined by wallet type.
220220
/// }
221-
/// credentials: Wallet credentials json.
221+
/// credentials_json: Wallet credentials json.
222222
/// {
223223
/// "key": string,
224224
/// "rekey": Optional<string>,
@@ -236,24 +236,24 @@ pub extern fn indy_create_wallet(command_handle: i32,
236236
pub extern fn indy_open_wallet(command_handle: i32,
237237
name: *const c_char,
238238
runtime_config: *const c_char,
239-
credentials: *const c_char,
239+
credentials_json: *const c_char,
240240
cb: Option<extern fn(xcommand_handle: i32,
241241
err: ErrorCode,
242242
handle: i32)>) -> ErrorCode {
243-
trace!("indy_open_wallet: >>> name: {:?}, runtime_config: {:?}, credentials: {:?}", name, runtime_config, credentials);
243+
trace!("indy_open_wallet: >>> name: {:?}, runtime_config: {:?}, credentials_json: {:?}", name, runtime_config, credentials_json);
244244

245245
check_useful_c_str!(name, ErrorCode::CommonInvalidParam2);
246246
check_useful_opt_c_str!(runtime_config, ErrorCode::CommonInvalidParam3);
247-
check_useful_c_str!(credentials, ErrorCode::CommonInvalidParam4);
247+
check_useful_c_str!(credentials_json, ErrorCode::CommonInvalidParam4);
248248
check_useful_c_callback!(cb, ErrorCode::CommonInvalidParam5);
249249

250-
trace!("indy_open_wallet: entities >>> name: {:?}, runtime_config: {:?}, credentials: {:?}", name, runtime_config, credentials);
250+
trace!("indy_open_wallet: entities >>> name: {:?}, runtime_config: {:?}, credentials_json: {:?}", name, runtime_config, credentials_json);
251251

252252
let result = CommandExecutor::instance()
253253
.send(Command::Wallet(WalletCommand::Open(
254254
name,
255255
runtime_config,
256-
credentials,
256+
credentials_json,
257257
Box::new(move |result| {
258258
let (err, handle) = result_to_err_code_1!(result, 0);
259259
trace!("indy_open_wallet: handle: {:?}", handle);
@@ -340,7 +340,7 @@ pub extern fn indy_close_wallet(command_handle: i32,
340340
///
341341
/// #Params
342342
/// name: Name of the wallet to delete.
343-
/// credentials: Wallet credentials json. List of supported keys are defined by wallet type.
343+
/// credentials_json: Wallet credentials json. List of supported keys are defined by wallet type.
344344
/// if NULL, then default credentials will be used.
345345
///
346346
/// #Returns
@@ -352,21 +352,21 @@ pub extern fn indy_close_wallet(command_handle: i32,
352352
#[no_mangle]
353353
pub extern fn indy_delete_wallet(command_handle: i32,
354354
name: *const c_char,
355-
credentials: *const c_char,
355+
credentials_json: *const c_char,
356356
cb: Option<extern fn(xcommand_handle: i32,
357357
err: ErrorCode)>) -> ErrorCode {
358-
trace!("indy_delete_wallet: >>> name: {:?}, credentials: {:?}", name, credentials);
358+
trace!("indy_delete_wallet: >>> name: {:?}, credentials_json: {:?}", name, credentials_json);
359359

360360
check_useful_c_str!(name, ErrorCode::CommonInvalidParam2);
361-
check_useful_c_str!(credentials, ErrorCode::CommonInvalidParam3);
361+
check_useful_c_str!(credentials_json, ErrorCode::CommonInvalidParam3);
362362
check_useful_c_callback!(cb, ErrorCode::CommonInvalidParam4);
363363

364-
trace!("indy_delete_wallet: entities >>> name: {:?}, credentials: {:?}", name, credentials);
364+
trace!("indy_delete_wallet: entities >>> name: {:?}, credentials_json: {:?}", name, credentials_json);
365365

366366
let result = CommandExecutor::instance()
367367
.send(Command::Wallet(WalletCommand::Delete(
368368
name,
369-
credentials,
369+
credentials_json,
370370
Box::new(move |result| {
371371
let err = result_to_err_code!(result);
372372
trace!("indy_delete_wallet:");
@@ -386,11 +386,11 @@ pub extern fn indy_delete_wallet(command_handle: i32,
386386
/// #Params
387387
/// name: wallet storage name (the same as wallet name)
388388
/// config: wallet storage config (For example, database config)
389-
/// credentials: wallet storage credentials (For example, database credentials)
389+
/// credentials_json: wallet storage credentials (For example, database credentials)
390390
/// metadata: wallet metadata (For example encrypted keys).
391391
pub type WalletCreate = extern fn(name: *const c_char,
392392
config: *const c_char,
393-
credentials: *const c_char,
393+
credentials_json: *const c_char,
394394
metadata: *const c_char) -> ErrorCode;
395395

396396
/// Open the wallet storage (For example, opening database connection)
@@ -399,12 +399,12 @@ pub type WalletCreate = extern fn(name: *const c_char,
399399
/// name: wallet storage name (the same as wallet name)
400400
/// config: wallet storage config (For example, database config)
401401
/// runtime_config: wallet storage runtime config (For example, connection config)
402-
/// credentials: wallet storage credentials (For example, database credentials)
402+
/// credentials_json: wallet storage credentials (For example, database credentials)
403403
/// storage_handle_p: pointer to store opened storage handle
404404
pub type WalletOpen = extern fn(name: *const c_char,
405405
config: *const c_char,
406406
runtime_config: *const c_char,
407-
credentials: *const c_char,
407+
credentials_json: *const c_char,
408408
storage_handle_p: *mut i32) -> ErrorCode;
409409

410410
/// Close the opened walled storage (For example, closing database connection)
@@ -418,10 +418,10 @@ pub type WalletClose = extern fn(storage_handle: i32) -> ErrorCode;
418418
/// #Params
419419
/// name: wallet storage name (the same as wallet name)
420420
/// config: wallet storage config (For example, database config)
421-
/// credentials: wallet storage credentials (For example, database credentials)
421+
/// credentials_json: wallet storage credentials (For example, database credentials)
422422
pub type WalletDelete = extern fn(name: *const c_char,
423423
config: *const c_char,
424-
credentials: *const c_char) -> ErrorCode;
424+
credentials_json: *const c_char) -> ErrorCode;
425425

426426
/// Create a new record in the wallet storage
427427
///

0 commit comments

Comments
 (0)