@@ -2500,48 +2500,10 @@ impl LDNApplication {
2500
2500
if res {
2501
2501
log:: info!( "Validated!" ) ;
2502
2502
return Ok ( true ) ;
2503
+ } else {
2504
+ log:: info!( "Validation failed!" ) ;
2505
+ return Ok ( false ) ;
2503
2506
}
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 ) ;
2545
2507
} ;
2546
2508
2547
2509
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.
3926
3888
if let Some ( gh_app) = active_from_gh. iter ( ) . find ( |& x| {
3927
3889
x. application_file . id == db_app. id && x. pr_number == db_app. pr_number as u64
3928
3890
} ) {
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 {
3930
3893
let parsed_app_file = serde_json:: to_string_pretty ( & gh_app. application_file )
3931
3894
. map_err ( |e| LDNError :: Load ( format ! ( "Failed to pare into string: {e}" ) ) ) ?;
3932
3895
database:: applications:: update_application (
@@ -4029,7 +3992,8 @@ _The initial issue can be edited in order to solve the request of the verifier.
4029
3992
. iter ( )
4030
3993
. find ( |& x| x. application_file . id == db_app. id )
4031
3994
{
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 {
4033
3997
let parsed_app_file = serde_json:: to_string_pretty ( & gh_app. application_file )
4034
3998
. map_err ( |e| LDNError :: Load ( format ! ( "Failed to pare into string: {e}" ) ) ) ?;
4035
3999
database:: applications:: update_application (
0 commit comments