@@ -970,10 +970,16 @@ impl LDNApplication {
970
970
. await
971
971
. map_err ( |e| LDNError :: Load ( format ! ( "Failed to get an allocator. /// {}" , e) ) ) ?
972
972
. ok_or ( LDNError :: Load ( "Allocator not found." . to_string ( ) ) ) ?;
973
- let db_multisig_address = db_allocator. multisig_address . ok_or ( LDNError :: Load (
974
- "Failed to get multisig address." . to_string ( ) ,
975
- ) ) ?;
976
- Self :: is_allowance_sufficient ( & db_multisig_address. clone ( ) , & allocation_amount_parsed)
973
+ let address_to_check_allowance = match db_allocator. tooling {
974
+ Some ( ref tooling) if tooling. contains ( "smart_contract_allocator" ) => db_allocator
975
+ . address
976
+ . ok_or_else ( || LDNError :: Load ( "Failed to get address." . to_string ( ) ) ) ,
977
+ _ => db_allocator
978
+ . multisig_address
979
+ . ok_or_else ( || LDNError :: Load ( "Failed to get multisig address." . to_string ( ) ) ) ,
980
+ } ?;
981
+
982
+ Self :: is_allowance_sufficient ( & address_to_check_allowance, & allocation_amount_parsed)
977
983
. await ?;
978
984
979
985
let uuid = uuidv4:: uuid:: v4 ( ) ;
@@ -1125,7 +1131,16 @@ impl LDNApplication {
1125
1131
1126
1132
if let Some ( new_allocation_amount) = new_allocation_amount {
1127
1133
if app_file. allocation . 0 . len ( ) > 1 {
1128
- Self :: is_allowance_sufficient ( & db_multisig_address, & new_allocation_amount) . await ?;
1134
+ let address_to_check_allowance = match db_allocator. tooling {
1135
+ Some ( ref tooling) if tooling. contains ( "smart_contract_allocator" ) => {
1136
+ db_allocator
1137
+ . address
1138
+ . ok_or_else ( || LDNError :: Load ( "Failed to get address." . to_string ( ) ) ) ?
1139
+ }
1140
+ _ => db_multisig_address,
1141
+ } ;
1142
+ Self :: is_allowance_sufficient ( & address_to_check_allowance, & new_allocation_amount)
1143
+ . await ?;
1129
1144
1130
1145
let parsed_allocation_amount = process_amount ( new_allocation_amount) ;
1131
1146
0 commit comments