@@ -851,12 +851,12 @@ pub mod custom_command {
851851 }
852852}
853853
854- pub mod get_sources_command {
854+ pub mod get_payment_sources_command {
855855 use super :: * ;
856856
857- command ! ( CommandMetadata :: build( "get-sources" , "Get sources list for payment address." )
857+ command ! ( CommandMetadata :: build( "get-payment- sources" , "Get sources list for payment address." )
858858 . add_required_param( "payment_address" , "Target payment address" )
859- . add_example( "ledger get-sources payment_address=pay:sov:GjZWsBLgZCR18aL468JAT7w9CZRiBnpxUPPgyQxh4voa" )
859+ . add_example( "ledger get-payment- sources payment_address=pay:sov:GjZWsBLgZCR18aL468JAT7w9CZRiBnpxUPPgyQxh4voa" )
860860 . finalize( )
861861 ) ;
862862
@@ -869,13 +869,13 @@ pub mod get_sources_command {
869869
870870 let payment_address = get_str_param ( "payment_address" , params) . map_err ( error_err ! ( ) ) ?;
871871
872- let ( request, payment_method) = Payment :: build_get_sources_request ( wallet_handle, & submitter_did, payment_address)
872+ let ( request, payment_method) = Payment :: build_get_payment_sources_request ( wallet_handle, & submitter_did, payment_address)
873873 . map_err ( |err| handle_payment_error ( err, None ) ) ?;
874874
875875 let response = Ledger :: submit_request ( pool_handle, & request)
876876 . map_err ( |err| handle_transaction_error ( err, None , Some ( & pool_name) , Some ( & wallet_name) ) ) ?;
877877
878- let res = match Payment :: parse_get_sources_response ( & payment_method, & response) {
878+ let res = match Payment :: parse_get_payment_sources_response ( & payment_method, & response) {
879879 Ok ( sources_json) => {
880880 let mut sources: Vec < serde_json:: Value > = serde_json:: from_str ( & sources_json)
881881 . map_err ( |_| println_err ! ( "Wrong data has been received" ) ) ?;
@@ -2897,11 +2897,11 @@ pub mod tests {
28972897 }
28982898
28992899 #[ cfg( feature = "nullpay_plugin" ) ]
2900- mod get_sources {
2900+ mod get_payment_sources {
29012901 use super :: * ;
29022902
29032903 #[ test]
2904- pub fn get_sources_works ( ) {
2904+ pub fn get_payment_sources_works ( ) {
29052905 TestUtils :: cleanup_storage ( ) ;
29062906 let ctx = CommandContext :: new ( ) ;
29072907
@@ -2912,7 +2912,7 @@ pub mod tests {
29122912 use_did ( & ctx, DID_TRUSTEE ) ;
29132913 let payment_address = create_address_and_mint_sources ( & ctx) ;
29142914 {
2915- let cmd = get_sources_command :: new ( ) ;
2915+ let cmd = get_payment_sources_command :: new ( ) ;
29162916 let mut params = CommandParams :: new ( ) ;
29172917 params. insert ( "payment_address" , payment_address) ;
29182918 cmd. execute ( & ctx, & params) . unwrap ( ) ;
@@ -2923,7 +2923,7 @@ pub mod tests {
29232923 }
29242924
29252925 #[ test]
2926- pub fn get_sources_works_for_no_sources ( ) {
2926+ pub fn get_payment_sources_works_for_no_sources ( ) {
29272927 TestUtils :: cleanup_storage ( ) ;
29282928 let ctx = CommandContext :: new ( ) ;
29292929
@@ -2933,7 +2933,7 @@ pub mod tests {
29332933 new_did ( & ctx, SEED_TRUSTEE ) ;
29342934 use_did ( & ctx, DID_TRUSTEE ) ;
29352935 {
2936- let cmd = get_sources_command :: new ( ) ;
2936+ let cmd = get_payment_sources_command :: new ( ) ;
29372937 let mut params = CommandParams :: new ( ) ;
29382938 params. insert ( "payment_address" , PAYMENT_ADDRESS . to_string ( ) ) ;
29392939 cmd. execute ( & ctx, & params) . unwrap ( ) ;
@@ -2944,7 +2944,7 @@ pub mod tests {
29442944 }
29452945
29462946 #[ test]
2947- pub fn get_sources_works_for_unknown_payment_method ( ) {
2947+ pub fn get_payment_sources_works_for_unknown_payment_method ( ) {
29482948 TestUtils :: cleanup_storage ( ) ;
29492949 let ctx = CommandContext :: new ( ) ;
29502950
@@ -2954,7 +2954,7 @@ pub mod tests {
29542954 new_did ( & ctx, SEED_TRUSTEE ) ;
29552955 use_did ( & ctx, DID_TRUSTEE ) ;
29562956 {
2957- let cmd = get_sources_command :: new ( ) ;
2957+ let cmd = get_payment_sources_command :: new ( ) ;
29582958 let mut params = CommandParams :: new ( ) ;
29592959 params. insert ( "payment_address" , format ! ( "pay:{}:test" , UNKNOWN_PAYMENT_METHOD ) ) ;
29602960 cmd. execute ( & ctx, & params) . unwrap_err ( ) ;
@@ -2965,7 +2965,7 @@ pub mod tests {
29652965 }
29662966
29672967 #[ test]
2968- pub fn get_sources_works_for_invalid_payment_address ( ) {
2968+ pub fn get_payment_sources_works_for_invalid_payment_address ( ) {
29692969 TestUtils :: cleanup_storage ( ) ;
29702970 let ctx = CommandContext :: new ( ) ;
29712971
@@ -2975,7 +2975,7 @@ pub mod tests {
29752975 new_did ( & ctx, SEED_TRUSTEE ) ;
29762976 use_did ( & ctx, DID_TRUSTEE ) ;
29772977 {
2978- let cmd = get_sources_command :: new ( ) ;
2978+ let cmd = get_payment_sources_command :: new ( ) ;
29792979 let mut params = CommandParams :: new ( ) ;
29802980 params. insert ( "payment_address" , INVALID_PAYMENT_ADDRESS . to_string ( ) ) ;
29812981 cmd. execute ( & ctx, & params) . unwrap_err ( ) ;
@@ -2986,14 +2986,14 @@ pub mod tests {
29862986 }
29872987
29882988 #[ test]
2989- pub fn get_sources_works_for_no_active_wallet ( ) {
2989+ pub fn get_payment_sources_works_for_no_active_wallet ( ) {
29902990 TestUtils :: cleanup_storage ( ) ;
29912991 let ctx = CommandContext :: new ( ) ;
29922992
29932993 create_and_connect_pool ( & ctx) ;
29942994 load_null_payment_plugin ( & ctx) ;
29952995 {
2996- let cmd = get_sources_command :: new ( ) ;
2996+ let cmd = get_payment_sources_command :: new ( ) ;
29972997 let mut params = CommandParams :: new ( ) ;
29982998 params. insert ( "payment_address" , INVALID_PAYMENT_ADDRESS . to_string ( ) ) ;
29992999 cmd. execute ( & ctx, & params) . unwrap_err ( ) ;
@@ -3003,15 +3003,15 @@ pub mod tests {
30033003 }
30043004
30053005 #[ test]
3006- pub fn get_sources_works_for_no_active_did ( ) {
3006+ pub fn get_payment_sources_works_for_no_active_did ( ) {
30073007 TestUtils :: cleanup_storage ( ) ;
30083008 let ctx = CommandContext :: new ( ) ;
30093009
30103010 create_and_connect_pool ( & ctx) ;
30113011 create_and_open_wallet ( & ctx) ;
30123012 load_null_payment_plugin ( & ctx) ;
30133013 {
3014- let cmd = get_sources_command :: new ( ) ;
3014+ let cmd = get_payment_sources_command :: new ( ) ;
30153015 let mut params = CommandParams :: new ( ) ;
30163016 params. insert ( "payment_address" , PAYMENT_ADDRESS . to_string ( ) ) ;
30173017 cmd. execute ( & ctx, & params) . unwrap_err ( ) ;
@@ -3871,10 +3871,10 @@ pub mod tests {
38713871 let ( wallet_handle, _) = get_opened_wallet ( ctx) . unwrap ( ) ;
38723872 let submitter_did = ensure_active_did ( & ctx) . unwrap ( ) ;
38733873
3874- let ( get_sources_txn_json, _) = Payment :: build_get_sources_request ( wallet_handle, & submitter_did, payment_address) . unwrap ( ) ;
3874+ let ( get_sources_txn_json, _) = Payment :: build_get_payment_sources_request ( wallet_handle, & submitter_did, payment_address) . unwrap ( ) ;
38753875 let response = Ledger :: submit_request ( pool_handle, & get_sources_txn_json) . unwrap ( ) ;
38763876
3877- let sources_json = Payment :: parse_get_sources_response ( NULL_PAYMENT_METHOD , & response) . unwrap ( ) ;
3877+ let sources_json = Payment :: parse_get_payment_sources_response ( NULL_PAYMENT_METHOD , & response) . unwrap ( ) ;
38783878
38793879 let sources = serde_json:: from_str :: < serde_json:: Value > ( & sources_json) . unwrap ( ) ;
38803880 let source: & serde_json:: Value = & sources. as_array ( ) . unwrap ( ) [ 0 ] ;
0 commit comments