@@ -194,6 +194,7 @@ pub struct ApplicationQueryParams {
194
194
#[ derive( Deserialize ) ]
195
195
pub struct CompleteGovernanceReviewInfo {
196
196
pub allocation_amount : String ,
197
+ pub client_contract_address : Option < String > ,
197
198
}
198
199
199
200
#[ derive( Deserialize ) ]
@@ -847,6 +848,7 @@ impl LDNApplication {
847
848
owner : String ,
848
849
repo : String ,
849
850
allocation_amount : String ,
851
+ client_contract_address : Option < String > ,
850
852
) -> Result < ApplicationFile , LDNError > {
851
853
match self . app_state ( ) . await {
852
854
Ok ( s) => match s {
@@ -878,7 +880,11 @@ impl LDNApplication {
878
880
allocation_amount_parsed,
879
881
) ;
880
882
881
- let app_file = app_file. complete_governance_review ( actor. clone ( ) , request) ;
883
+ let app_file = app_file. complete_governance_review (
884
+ actor. clone ( ) ,
885
+ request,
886
+ client_contract_address. clone ( ) ,
887
+ ) ;
882
888
let file_content = serde_json:: to_string_pretty ( & app_file) . unwrap ( ) ;
883
889
let app_path = & self . file_name . clone ( ) ;
884
890
let app_branch = self . branch_name . clone ( ) ;
@@ -904,16 +910,23 @@ impl LDNApplication {
904
910
Ok ( prs) => {
905
911
if let Some ( pr) = prs. first ( ) {
906
912
let number = pr. number ;
907
- let _ = database:: applications:: update_application (
913
+ database:: applications:: update_application (
908
914
app_file. id . clone ( ) ,
909
915
owner. clone ( ) ,
910
916
repo. clone ( ) ,
911
917
number,
912
918
serde_json:: to_string_pretty ( & app_file) . unwrap ( ) ,
913
919
Some ( app_path. clone ( ) ) ,
914
920
None ,
921
+ client_contract_address,
915
922
)
916
- . await ;
923
+ . await
924
+ . map_err ( |e| {
925
+ LDNError :: Load ( format ! (
926
+ "Failed to update application: {} /// {}" ,
927
+ app_file. id, e
928
+ ) )
929
+ } ) ?;
917
930
918
931
Self :: issue_datacap_allocation_requested (
919
932
app_file. clone ( ) ,
@@ -1064,16 +1077,23 @@ impl LDNApplication {
1064
1077
Ok ( prs) => {
1065
1078
if let Some ( pr) = prs. first ( ) {
1066
1079
let number = pr. number ;
1067
- let _ = database:: applications:: update_application (
1080
+ database:: applications:: update_application (
1068
1081
app_file. id . clone ( ) ,
1069
1082
owner. clone ( ) ,
1070
1083
repo. clone ( ) ,
1071
1084
number,
1072
1085
serde_json:: to_string_pretty ( & app_file) . unwrap ( ) ,
1073
1086
Some ( self . file_name . clone ( ) ) ,
1074
1087
None ,
1088
+ app_file. client_contract_address . clone ( ) ,
1075
1089
)
1076
- . await ;
1090
+ . await
1091
+ . map_err ( |e| {
1092
+ LDNError :: Load ( format ! (
1093
+ "Failed to update application: {} /// {}" ,
1094
+ app_file. id, e
1095
+ ) )
1096
+ } ) ?;
1077
1097
Self :: issue_start_sign_dc (
1078
1098
app_file. issue_number . clone ( ) ,
1079
1099
owner. clone ( ) ,
@@ -1223,6 +1243,7 @@ impl LDNApplication {
1223
1243
serde_json:: to_string_pretty ( & app_file) . unwrap ( ) ,
1224
1244
Some ( self . file_name . clone ( ) ) ,
1225
1245
None ,
1246
+ app_file. client_contract_address . clone ( ) ,
1226
1247
)
1227
1248
. await
1228
1249
{
@@ -1994,6 +2015,7 @@ impl LDNApplication {
1994
2015
serde_json:: to_string_pretty ( & app_file) . unwrap ( ) ,
1995
2016
Some ( ldn_application. file_name . clone ( ) ) ,
1996
2017
None ,
2018
+ app_file. client_contract_address ,
1997
2019
)
1998
2020
. await ;
1999
2021
}
@@ -2066,6 +2088,7 @@ impl LDNApplication {
2066
2088
serde_json:: to_string_pretty ( & db_application_file) . unwrap ( ) ,
2067
2089
Some ( filename. clone ( ) ) ,
2068
2090
None ,
2091
+ db_application_file. client_contract_address . clone ( ) ,
2069
2092
)
2070
2093
. await ;
2071
2094
@@ -2364,6 +2387,7 @@ impl LDNApplication {
2364
2387
file_content. clone ( ) ,
2365
2388
Some ( filename. clone ( ) ) ,
2366
2389
None ,
2390
+ application_file. client_contract_address . clone ( ) ,
2367
2391
)
2368
2392
. await
2369
2393
. map_err ( |e| {
@@ -2667,6 +2691,7 @@ impl LDNApplication {
2667
2691
parsed_ldn. datacap ,
2668
2692
pr_application. allocation . clone ( ) ,
2669
2693
pr_application. lifecycle . clone ( ) ,
2694
+ pr_application. client_contract_address . clone ( ) ,
2670
2695
)
2671
2696
. await ;
2672
2697
@@ -2722,16 +2747,23 @@ impl LDNApplication {
2722
2747
if let Some ( pr) = prs. first ( ) {
2723
2748
let number = pr. number ;
2724
2749
2725
- let _ = database:: applications:: update_application (
2750
+ database:: applications:: update_application (
2726
2751
app_file. id . clone ( ) ,
2727
2752
application_model. owner . clone ( ) ,
2728
2753
application_model. repo . clone ( ) ,
2729
2754
number,
2730
2755
serde_json:: to_string_pretty ( & app_file) . unwrap ( ) ,
2731
2756
Some ( application_model. path . clone ( ) . unwrap ( ) ) ,
2732
2757
None ,
2758
+ app_file. client_contract_address ,
2733
2759
)
2734
- . await ;
2760
+ . await
2761
+ . map_err ( |e| {
2762
+ LDNError :: Load ( format ! (
2763
+ "Failed to update application: {} /// {}" ,
2764
+ app_file. id, e
2765
+ ) )
2766
+ } ) ?;
2735
2767
}
2736
2768
}
2737
2769
Err ( e) => log:: warn!( "Failed to get pull request by head: {}" , e) ,
@@ -2805,6 +2837,7 @@ impl LDNApplication {
2805
2837
parsed_ldn. datacap ,
2806
2838
merged_application. allocation . clone ( ) ,
2807
2839
merged_application. lifecycle . clone ( ) ,
2840
+ merged_application. client_contract_address . clone ( ) ,
2808
2841
)
2809
2842
. await ;
2810
2843
@@ -3482,6 +3515,7 @@ _The initial issue can be edited in order to solve the request of the verifier.
3482
3515
serde_json:: to_string_pretty ( & gh_app. application_file ) . unwrap ( ) ,
3483
3516
None ,
3484
3517
Some ( gh_app. sha . clone ( ) ) ,
3518
+ gh_app. application_file . client_contract_address . clone ( ) ,
3485
3519
)
3486
3520
. await
3487
3521
. unwrap ( ) ;
@@ -3564,6 +3598,7 @@ _The initial issue can be edited in order to solve the request of the verifier.
3564
3598
serde_json:: to_string_pretty ( & gh_app. application_file ) . unwrap ( ) ,
3565
3599
Some ( gh_app. path . clone ( ) ) ,
3566
3600
Some ( gh_app. sha . clone ( ) ) ,
3601
+ gh_app. application_file . client_contract_address . clone ( ) ,
3567
3602
)
3568
3603
. await
3569
3604
. unwrap ( ) ;
@@ -3787,6 +3822,7 @@ _The initial issue can be edited in order to solve the request of the verifier.
3787
3822
serde_json:: to_string_pretty ( & application_file) . unwrap ( ) ,
3788
3823
app_model. path . clone ( ) ,
3789
3824
None ,
3825
+ application_file. client_contract_address . clone ( ) ,
3790
3826
)
3791
3827
. await
3792
3828
. expect ( "Failed to update_application in DB!" ) ;
@@ -3933,6 +3969,7 @@ _The initial issue can be edited in order to solve the request of the verifier.
3933
3969
serde_json:: to_string_pretty ( & application_file) . unwrap ( ) ,
3934
3970
app_model. path . clone ( ) ,
3935
3971
None ,
3972
+ application_file. client_contract_address . clone ( ) ,
3936
3973
)
3937
3974
. await
3938
3975
. expect ( "Failed to update_application in DB!" ) ;
0 commit comments