@@ -2500,48 +2500,10 @@ impl LDNApplication {
25002500 if res {
25012501 log:: info!( "Validated!" ) ;
25022502 return Ok ( true ) ;
2503+ } else {
2504+ log:: info!( "Validation failed!" ) ;
2505+ return Ok ( false ) ;
25032506 }
2504-
2505- let app_file = application_file. move_back_to_governance_review ( ) ;
2506- let ldn_application =
2507- LDNApplication :: load ( app_file. id . clone ( ) , owner. clone ( ) , repo. clone ( ) ) . await ?;
2508- let parsed_app_file = serde_json:: to_string_pretty ( & app_file)
2509- . map_err ( |e| LDNError :: Load ( format ! ( "Failed to pare into string: {e}" ) ) ) ?;
2510- let new_file_sha = LDNPullRequest :: add_commit_to (
2511- ldn_application. file_name . clone ( ) ,
2512- ldn_application. branch_name . clone ( ) ,
2513- "Move application back to review" . to_string ( ) ,
2514- parsed_app_file. clone ( ) ,
2515- ldn_application. file_sha . clone ( ) ,
2516- owner. clone ( ) ,
2517- repo. clone ( ) ,
2518- )
2519- . await ?;
2520-
2521- let gh = github_async_new ( owner. to_string ( ) , repo. to_string ( ) ) . await ?;
2522-
2523- let prs = gh
2524- . get_pull_request_by_head ( & ldn_application. branch_name )
2525- . await
2526- . map_err ( |e| LDNError :: Load ( format ! ( "Failed to get pull request by head: {e}" ) ) ) ?;
2527-
2528- if let Some ( pr) = prs. first ( ) {
2529- let number = pr. number ;
2530- database:: applications:: update_application (
2531- app_file. id . clone ( ) ,
2532- owner,
2533- repo,
2534- number,
2535- parsed_app_file,
2536- Some ( ldn_application. file_name . clone ( ) ) ,
2537- new_file_sha,
2538- app_file. client_contract_address ,
2539- )
2540- . await
2541- . map_err ( |e| LDNError :: Load ( format ! ( "Failed to update application: {e}" ) ) ) ?;
2542- } ;
2543-
2544- return Ok ( false ) ;
25452507 } ;
25462508
25472509 log:: info!( "Failed to fetch Application File" ) ;
@@ -3926,7 +3888,8 @@ _The initial issue can be edited in order to solve the request of the verifier.
39263888 if let Some ( gh_app) = active_from_gh. iter ( ) . find ( |& x| {
39273889 x. application_file . id == db_app. id && x. pr_number == db_app. pr_number as u64
39283890 } ) {
3929- if gh_app. updated_at > db_app. updated_at {
3891+ let db_sha = db_app. sha . clone ( ) . unwrap_or_default ( ) ;
3892+ if gh_app. updated_at > db_app. updated_at || gh_app. sha != db_sha {
39303893 let parsed_app_file = serde_json:: to_string_pretty ( & gh_app. application_file )
39313894 . map_err ( |e| LDNError :: Load ( format ! ( "Failed to pare into string: {e}" ) ) ) ?;
39323895 database:: applications:: update_application (
@@ -4029,7 +3992,8 @@ _The initial issue can be edited in order to solve the request of the verifier.
40293992 . iter ( )
40303993 . find ( |& x| x. application_file . id == db_app. id )
40313994 {
4032- if gh_app. updated_at > db_app. updated_at {
3995+ let db_sha = db_app. sha . clone ( ) . unwrap_or_default ( ) ;
3996+ if gh_app. updated_at > db_app. updated_at || gh_app. sha != db_sha {
40333997 let parsed_app_file = serde_json:: to_string_pretty ( & gh_app. application_file )
40343998 . map_err ( |e| LDNError :: Load ( format ! ( "Failed to pare into string: {e}" ) ) ) ?;
40353999 database:: applications:: update_application (
0 commit comments