Browse Source

GUI: fix bug in fee wizard

Herman Schoenfeld 7 years ago
parent
commit
b8c8a462f6

+ 1 - 0
src/gui/wizards/operations/UWIZOperationFee_Custom.lfm

@@ -7,6 +7,7 @@ object WIZOperationFee_Custom: TWIZOperationFee_Custom
   Caption = 'WIZOperationFee_Custom'
   ClientHeight = 253
   ClientWidth = 429
+  LCLVersion = '1.8.2.0'
   Visible = False
   object gbTransactionFee: TGroupBox
     Left = 0

+ 4 - 4
src/gui/wizards/operations/UWIZOperationFee_Custom.pas

@@ -73,8 +73,8 @@ begin
     TSettings.Save;
   end;
 
-  Model.Fee.SingleOperationFee := Fee;
   Model.Signer.SignerCandidates := TCoreTool.GetSignerCandidates(Length(Model.Account.SelectedAccounts), Fee, Model.Account.SelectedAccounts);
+  Model.Fee.SingleOperationFee := Fee;
 
   // TODO: move this out -- inappropriate to have payload/signer considerations here
   if Model.Payload.HasPayload then
@@ -91,12 +91,12 @@ end;
 function TWIZOperationFee_Custom.Validate(out message: ansistring): boolean;
 begin
   if (Length(Model.Account.SelectedAccounts) > 1) AND (Fee = 0) then begin
-    message := 'Insufficient fee for multiple operations. Zero fees only allowed for single operation.';
+    message := 'Zero fees only allowed for a single operation.';
     Exit(false);
   end;
 
-  if Length(TCoreTool.GetSignerCandidates(Length(Model.Account.SelectedAccounts), Model.Fee.SingleOperationFee, Model.Account.SelectedAccounts)) = 0 then begin
-    message := 'No Valid Signer Account Was Found With The Current Requirements.';
+  if Length(TCoreTool.GetSignerCandidates(Length(Model.Account.SelectedAccounts), Fee, Model.Account.SelectedAccounts)) = 0 then begin
+    message := 'Insufficient funds in selected account(s) to cover the total fee.';
     Exit(false);
   end;
 end;