Browse Source

variable name refactoring.

Ugochukwu Mmaduekwe 7 years ago
parent
commit
c15e8d1d2a

+ 18 - 18
src/core.utils/UCoreUtils.pas

@@ -222,7 +222,7 @@ begin
         // With defined password
         // With defined password
         if APayloadEncryptionPassword = '' then
         if APayloadEncryptionPassword = '' then
         begin
         begin
-          AErrorMessage := 'Payload Encryption Password Cannot be Empty with the Chosen Option : "Encrypt With Password."';
+          AErrorMessage := 'Payload Encryption Password Cannot Be Empty With The Chosen Option : "Encrypt With Password."';
           Exit(False);
           Exit(False);
         end;
         end;
         AEncodedPayloadBytes := TAESComp.EVP_Encrypt_AES256(
         AEncodedPayloadBytes := TAESComp.EVP_Encrypt_AES256(
@@ -249,7 +249,7 @@ begin
       if Length(AEncodedPayloadBytes) > CT_MaxPayloadSize then
       if Length(AEncodedPayloadBytes) > CT_MaxPayloadSize then
       begin
       begin
         LValid := False;
         LValid := False;
-        AErrorMessage := Format('Payload Size is %d Which is Bigger Than %d', [Length(AEncodedPayloadBytes), CT_MaxPayloadSize]);
+        AErrorMessage := Format('Payload Size Is %d Which Is Bigger Than %d', [Length(AEncodedPayloadBytes), CT_MaxPayloadSize]);
       end;
       end;
     Result := LValid;
     Result := LValid;
   end;
   end;
@@ -366,7 +366,7 @@ begin
 
 
       if LCurrentAccount.account = ADestinationAccount.account then
       if LCurrentAccount.account = ADestinationAccount.account then
       begin
       begin
-        AErrorMessage := Format('Sender "%s" and Destination "%s" Accounts are the Same', [LCurrentAccount.AccountString, ADestinationAccount.AccountString]);
+        AErrorMessage := Format('Sender "%s" And Destination "%s" Accounts Are The Same', [LCurrentAccount.AccountString, ADestinationAccount.AccountString]);
         Exit(False);
         Exit(False);
       end;
       end;
 
 
@@ -411,7 +411,7 @@ begin
             end
             end
             else
             else
             begin
             begin
-              AErrorMessage := Format('Insufficient Funds in "%s". %s < (%s + %s = %s)', [LCurrentAccount.AccountString, TAccountComp.FormatMoney(LCurrentAccount.balance), TAccountComp.FormatMoney(AAmount), TAccountComp.FormatMoney(AFee), TAccountComp.FormatMoney(AAmount + AFee)]);
+              AErrorMessage := Format('Insufficient Funds In "%s". %s < (%s + %s = %s)', [LCurrentAccount.AccountString, TAccountComp.FormatMoney(LCurrentAccount.balance), TAccountComp.FormatMoney(AAmount), TAccountComp.FormatMoney(AFee), TAccountComp.FormatMoney(AAmount + AFee)]);
               Exit(False);
               Exit(False);
             end;
             end;
         end
         end
@@ -423,7 +423,7 @@ begin
         LPCOperation := TOpTransaction.CreateTransaction(
         LPCOperation := TOpTransaction.CreateTransaction(
           LCurrentAccount.account, LCurrentAccount.n_operation + 1, ADestinationAccount.account, LWalletKey.PrivateKey, LAmount, LFee, LPayloadEncodedBytes);
           LCurrentAccount.account, LCurrentAccount.n_operation + 1, ADestinationAccount.account, LWalletKey.PrivateKey, LAmount, LFee, LPayloadEncodedBytes);
         try
         try
-          LOperationsTxt := Format('Transaction to "%s"', [ADestinationAccount.AccountString]);
+          LOperationsTxt := Format('Transaction To "%s"', [ADestinationAccount.AccountString]);
 
 
           if Assigned(LPCOperation) then
           if Assigned(LPCOperation) then
           begin
           begin
@@ -443,7 +443,7 @@ begin
     end;
     end;
     if (LOperationsHashTree.OperationsCount = 0) then
     if (LOperationsHashTree.OperationsCount = 0) then
     begin
     begin
-      AErrorMessage := 'No Valid Operation to Execute';
+      AErrorMessage := 'No Valid Operation To Execute';
       Exit(False);
       Exit(False);
     end;
     end;
 
 
@@ -507,7 +507,7 @@ begin
       if (TAccountComp.EqualAccountKeys(LCurrentAccount.accountInfo.accountKey,
       if (TAccountComp.EqualAccountKeys(LCurrentAccount.accountInfo.accountKey,
         APublicKey)) then
         APublicKey)) then
       begin
       begin
-        AErrorMessage := 'New Key is Same as Current Key';
+        AErrorMessage := 'New Key Is Same As Current Key';
         Exit(False);
         Exit(False);
       end;
       end;
 
 
@@ -518,13 +518,13 @@ begin
         if (TAccountComp.IsAccountLocked(LSignerAccount.accountInfo,
         if (TAccountComp.IsAccountLocked(LSignerAccount.accountInfo,
           LNode.Bank.BlocksCount)) then
           LNode.Bank.BlocksCount)) then
         begin
         begin
-          AErrorMessage := Format('Signer Account "%s" is Locked Until Block %u', [LSignerAccount.AccountString, LSignerAccount.accountInfo.locked_until_block]);
+          AErrorMessage := Format('Signer Account "%s"  Is Locked Until Block %u', [LSignerAccount.AccountString, LSignerAccount.accountInfo.locked_until_block]);
           Exit(False);
           Exit(False);
         end;
         end;
         if (not TAccountComp.EqualAccountKeys(
         if (not TAccountComp.EqualAccountKeys(
           LSignerAccount.accountInfo.accountKey, LCurrentAccount.accountInfo.accountKey)) then
           LSignerAccount.accountInfo.accountKey, LCurrentAccount.accountInfo.accountKey)) then
         begin
         begin
-          AErrorMessage := Format('Signer Account %s is Not The Owner Of Account %s', [LSignerAccount.AccountString, LCurrentAccount.AccountString]);
+          AErrorMessage := Format('Signer Account %s Is Not The Owner Of Account %s', [LSignerAccount.AccountString, LCurrentAccount.AccountString]);
           Exit(False);
           Exit(False);
         end;
         end;
       end
       end
@@ -548,9 +548,9 @@ begin
       if not Assigned(LWalletKey.PrivateKey) then
       if not Assigned(LWalletKey.PrivateKey) then
       begin
       begin
         if LWalletKey.HasPrivateKey then
         if LWalletKey.HasPrivateKey then
-          AErrorMessage := 'Wallet is Password Protected. Please Unlock Before You Proceed.'
+          AErrorMessage := 'Wallet Is Password Protected. Please Unlock Before You Proceed.'
         else
         else
-          AErrorMessage := Format('Only Public Key of Account %s Was Found in Wallet. You Cannot Operate This Account', [LCurrentAccount.AccountString]);
+          AErrorMessage := Format('Only Public Key of Account %s Was Found In Wallet. You Cannot Operate This Account', [LCurrentAccount.AccountString]);
         Exit(False);
         Exit(False);
       end;
       end;
 
 
@@ -582,7 +582,7 @@ begin
           1, LCurrentAccount.account, LWalletKey.PrivateKey, APublicKey, LFee, LPayloadEncodedBytes);
           1, LCurrentAccount.account, LWalletKey.PrivateKey, APublicKey, LFee, LPayloadEncodedBytes);
 
 
       try
       try
-        LOperationsTxt := Format('Change Key to "%s"', [TAccountComp.GetECInfoTxt(APublicKey.EC_OpenSSL_NID)]);
+        LOperationsTxt := Format('Change Key To "%s"', [TAccountComp.GetECInfoTxt(APublicKey.EC_OpenSSL_NID)]);
         if Assigned(LPCOperation) then
         if Assigned(LPCOperation) then
         begin
         begin
           LOperationsHashTree.AddOperationToHashTree(LPCOperation);
           LOperationsHashTree.AddOperationToHashTree(LPCOperation);
@@ -659,13 +659,13 @@ begin
 
 
       if TAccountComp.IsAccountForSale(LCurrentAccount.accountInfo) then
       if TAccountComp.IsAccountForSale(LCurrentAccount.accountInfo) then
       begin
       begin
-        AErrorMessage := Format('Account "%s" is Already Enlisted For Sale', [LCurrentAccount.AccountString]);
+        AErrorMessage := Format('Account "%s" Is Already Enlisted For Sale', [LCurrentAccount.AccountString]);
         Exit(False);
         Exit(False);
       end;
       end;
 
 
       if (ASellerAccount.account = LCurrentAccount.account) then
       if (ASellerAccount.account = LCurrentAccount.account) then
       begin
       begin
-        AErrorMessage := 'Seller Account Cannot be Same as Account to be Sold.';
+        AErrorMessage := 'Seller Account Cannot Be Same As Account To Be Sold.';
         Exit(False);
         Exit(False);
       end;
       end;
 
 
@@ -681,7 +681,7 @@ begin
         if TAccountComp.EqualAccountKeys(APublicKey,
         if TAccountComp.EqualAccountKeys(APublicKey,
           LCurrentAccount.accountInfo.accountKey) then
           LCurrentAccount.accountInfo.accountKey) then
         begin
         begin
-          AErrorMessage := 'You Cannot Sell to an Account That You Want to Enlist For Sale.';
+          AErrorMessage := 'You Cannot Sell To An Account That You Want To Enlist For Sale.';
           Exit(False);
           Exit(False);
         end;
         end;
 
 
@@ -709,9 +709,9 @@ begin
       if not Assigned(LWalletKey.PrivateKey) then
       if not Assigned(LWalletKey.PrivateKey) then
       begin
       begin
         if LWalletKey.HasPrivateKey then
         if LWalletKey.HasPrivateKey then
-          AErrorMessage := 'Wallet is Password Protected. Please Unlock Before You Proceed.'
+          AErrorMessage := 'Wallet Is Password Protected. Please Unlock Before You Proceed.'
         else
         else
-          AErrorMessage := Format('Only Public Key of Account %s Was Found in Wallet. You Cannot Operate This Account', [LCurrentAccount.AccountString]);
+          AErrorMessage := Format('Only Public Key Of Account %s Was Found In Wallet. You Cannot Operate This Account', [LCurrentAccount.AccountString]);
         Exit(False);
         Exit(False);
       end;
       end;
 
 
@@ -740,7 +740,7 @@ begin
       end;
       end;
 
 
       try
       try
-        LOperationsTxt := Format('Enlist Account For Sale at a Price of "%s" PASC', [TAccountComp.FormatMoney(ASalePrice)]);
+        LOperationsTxt := Format('Enlist Account For Sale At a Price Of "%s" PASC', [TAccountComp.FormatMoney(ASalePrice)]);
         if Assigned(LPCOperation) then
         if Assigned(LPCOperation) then
         begin
         begin
           LOperationsHashTree.AddOperationToHashTree(LPCOperation);
           LOperationsHashTree.AddOperationToHashTree(LPCOperation);

+ 8 - 8
src/gui/wizards/operations/UWIZChangeKey_EnterKey.pas

@@ -84,26 +84,26 @@ end;
 
 
 function TWIZChangeKey_EnterKey.Validate(out message: ansistring): boolean;
 function TWIZChangeKey_EnterKey.Validate(out message: ansistring): boolean;
 var
 var
-  tempAccountKey: TAccountKey;
-  i: integer;
+  LTempAccountKey: TAccountKey;
+  LIdx: integer;
 begin
 begin
   Result := True;
   Result := True;
   if not TAccountComp.AccountKeyFromImport(Trim(mmoNewPrivateKey.Lines.Text),
   if not TAccountComp.AccountKeyFromImport(Trim(mmoNewPrivateKey.Lines.Text),
-    tempAccountKey, message) then
+    LTempAccountKey, message) then
   begin
   begin
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-    if TAccountComp.EqualAccountKeys(Model.Account.SelectedAccounts[i].accountInfo.accountKey,
-      tempAccountKey) then
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    if TAccountComp.EqualAccountKeys(Model.Account.SelectedAccounts[LIdx].accountInfo.accountKey,
+      LTempAccountKey) then
     begin
     begin
       Result := False;
       Result := False;
-      message := 'New key is same as current key';
+      message := 'New Key Is Same As Current Key';
       Exit;
       Exit;
     end;
     end;
 
 
-  Model.TransferAccount.AccountKey := tempAccountKey;
+  Model.TransferAccount.AccountKey := LTempAccountKey;
 end;
 end;
 
 
 end.
 end.

+ 23 - 23
src/gui/wizards/operations/UWIZChangeKey_SelectKey.pas

@@ -53,8 +53,8 @@ uses
 
 
 procedure TWIZChangeKey_SelectKey.cbNewPrivateKeyChange(Sender: TObject);
 procedure TWIZChangeKey_SelectKey.cbNewPrivateKeyChange(Sender: TObject);
 var
 var
-  i: integer;
-  wk: TWalletKey;
+  LIdx: integer;
+  LWalletKey: TWalletKey;
 begin
 begin
   if cbNewPrivateKey.ItemIndex < 1 then
   if cbNewPrivateKey.ItemIndex < 1 then
   begin
   begin
@@ -64,19 +64,19 @@ begin
   else
   else
   begin
   begin
     lblKeyName.Font.Color := clGreen;
     lblKeyName.Font.Color := clGreen;
-    i := PtrInt(cbNewPrivateKey.Items.Objects[cbNewPrivateKey.ItemIndex]);
-    wk := TWallet.Keys.Key[i];
+    LIdx := PtrInt(cbNewPrivateKey.Items.Objects[cbNewPrivateKey.ItemIndex]);
+    LWalletKey := TWallet.Keys.Key[LIdx];
     lblKeyName.Caption := Format('%s ',
     lblKeyName.Caption := Format('%s ',
-      [IIF(wk.Name = '', TCrypto.ToHexaString(
-      TAccountComp.AccountKey2RawString(wk.AccountKey)), wk.Name)]);
+      [IIF(LWalletKey.Name = '', TCrypto.ToHexaString(
+      TAccountComp.AccountKey2RawString(LWalletKey.AccountKey)), LWalletKey.Name)]);
   end;
   end;
 end;
 end;
 
 
 procedure TWIZChangeKey_SelectKey.UpdateWalletKeys();
 procedure TWIZChangeKey_SelectKey.UpdateWalletKeys();
 var
 var
-  i: integer;
-  wk: TWalletKey;
-  s: string;
+  LIdx: integer;
+  LWalletKey: TWalletKey;
+  LBuilder: string;
 begin
 begin
   cbNewPrivateKey.items.BeginUpdate;
   cbNewPrivateKey.items.BeginUpdate;
   try
   try
@@ -84,13 +84,13 @@ begin
     cbNewPrivateKey.Items.Add('Select Private Key');
     cbNewPrivateKey.Items.Add('Select Private Key');
     if not Assigned(TWallet.Keys) then
     if not Assigned(TWallet.Keys) then
       Exit;
       Exit;
-    for i := 0 to TWallet.Keys.Count - 1 do
+    for LIdx := 0 to TWallet.Keys.Count - 1 do
     begin
     begin
-      wk := TWallet.Keys.Key[i];
-      s := IIF(wk.Name = '', TCrypto.ToHexaString(TAccountComp.AccountKey2RawString(wk.AccountKey)), wk.Name);
-      if not Assigned(wk.PrivateKey) then
-        s := s + '(*)';
-      cbNewPrivateKey.Items.AddObject(s, TObject(i));
+      LWalletKey := TWallet.Keys.Key[LIdx];
+      LBuilder := IIF(LWalletKey.Name = '', TCrypto.ToHexaString(TAccountComp.AccountKey2RawString(LWalletKey.AccountKey)), LWalletKey.Name);
+      if not Assigned(LWalletKey.PrivateKey) then
+        LBuilder := LBuilder + '(*)';
+      cbNewPrivateKey.Items.AddObject(LBuilder, TObject(LIdx));
     end;
     end;
     cbNewPrivateKey.Sorted := True;
     cbNewPrivateKey.Sorted := True;
   finally
   finally
@@ -140,25 +140,25 @@ end;
 
 
 function TWIZChangeKey_SelectKey.Validate(out message: ansistring): boolean;
 function TWIZChangeKey_SelectKey.Validate(out message: ansistring): boolean;
 var
 var
-  i: integer;
-  tempAccountKey: TAccountKey;
+  LIdx: integer;
+  LAccountKey: TAccountKey;
 begin
 begin
   Result := True;
   Result := True;
   if cbNewPrivateKey.ItemIndex < 1 then
   if cbNewPrivateKey.ItemIndex < 1 then
   begin
   begin
-    message := 'A key must be selected';
+    message := 'A Key Must Be Selected';
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  tempAccountKey := TWallet.Keys.Key[PtrInt(cbNewPrivateKey.Items.Objects[cbNewPrivateKey.ItemIndex])].AccountKey;
+  LAccountKey := TWallet.Keys.Key[PtrInt(cbNewPrivateKey.Items.Objects[cbNewPrivateKey.ItemIndex])].AccountKey;
 
 
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-    if TAccountComp.EqualAccountKeys(Model.Account.SelectedAccounts[i].accountInfo.accountKey,
-      tempAccountKey) then
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    if TAccountComp.EqualAccountKeys(Model.Account.SelectedAccounts[LIdx].accountInfo.accountKey,
+      LAccountKey) then
     begin
     begin
       Result := False;
       Result := False;
-      message := 'New key is same as current key';
+      message := 'New Key Is Same As Current Key';
       Exit;
       Exit;
     end;
     end;
 
 

+ 6 - 6
src/gui/wizards/operations/UWIZEnlistAccountForSale_EnterLockingBlock.pas

@@ -45,18 +45,18 @@ end;
 
 
 function TWIZEnlistAccountForSale_EnterLockingBlock.Validate(out message: ansistring): boolean;
 function TWIZEnlistAccountForSale_EnterLockingBlock.Validate(out message: ansistring): boolean;
 var
 var
-  LockedUntilBlock: cardinal;
+  LLockedUntilBlock: cardinal;
 begin
 begin
   Result := True;
   Result := True;
 
 
-  LockedUntilBlock := StrToIntDef(edtBlockLock.Text, 0);
-  if LockedUntilBlock = 0 then
+  LLockedUntilBlock := StrToIntDef(edtBlockLock.Text, 0);
+  if LLockedUntilBlock = 0 then
   begin
   begin
-    message := 'Insert locking block';
+    message := 'You Didn''t Insert a Locking Block.';
     Result := False;
     Result := False;
-    exit;
+    Exit;
   end;
   end;
-  Model.EnlistAccountForSale.LockedUntilBlock := LockedUntilBlock;
+  Model.EnlistAccountForSale.LockedUntilBlock := LLockedUntilBlock;
 
 
 end;
 end;
 
 

+ 7 - 7
src/gui/wizards/operations/UWIZEnlistAccountForSale_EnterPublicKey.pas

@@ -47,29 +47,29 @@ end;
 
 
 procedure TWIZEnlistAccountForSale_EnterPublicKey.OnNext;
 procedure TWIZEnlistAccountForSale_EnterPublicKey.OnNext;
 begin
 begin
-   UpdatePath(ptInject, [TWIZEnlistAccountForSale_EnterLockingBlock]);
+  UpdatePath(ptInject, [TWIZEnlistAccountForSale_EnterLockingBlock]);
 end;
 end;
 
 
 function TWIZEnlistAccountForSale_EnterPublicKey.Validate(out message: ansistring): boolean;
 function TWIZEnlistAccountForSale_EnterPublicKey.Validate(out message: ansistring): boolean;
 var
 var
-  i: integer;
+  LIdx: integer;
 begin
 begin
   Result := True;
   Result := True;
 
 
   if not TAccountComp.AccountKeyFromImport(Trim(mmoPublicKey.Lines.Text),
   if not TAccountComp.AccountKeyFromImport(Trim(mmoPublicKey.Lines.Text),
     Model.EnlistAccountForSale.NewOwnerPublicKey, message) then
     Model.EnlistAccountForSale.NewOwnerPublicKey, message) then
   begin
   begin
-    message := 'Public key: ' + message;
+    message := Format('Error Importing Public Key, Specific Error: %s', [message]);
     Result := False;
     Result := False;
-    exit;
+    Exit;
 
 
   end;
   end;
 
 
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
     if TAccountComp.EqualAccountKeys(Model.EnlistAccountForSale.NewOwnerPublicKey,
     if TAccountComp.EqualAccountKeys(Model.EnlistAccountForSale.NewOwnerPublicKey,
-      Model.Account.SelectedAccounts[i].accountInfo.accountKey) then
+      Model.Account.SelectedAccounts[LIdx].accountInfo.accountKey) then
     begin
     begin
-      message := 'New public key for private sale is the same public key';
+      message := 'You Cannot Sell To An Account That You Want To Enlist For Sale.';
       Result := False;
       Result := False;
       Exit;
       Exit;
     end;
     end;

+ 7 - 9
src/gui/wizards/operations/UWIZEnlistAccountForSale_EnterSaleAmount.pas

@@ -33,7 +33,6 @@ type
     procedure UpdateUI();
     procedure UpdateUI();
 
 
 
 
-
   public
   public
     procedure OnPresent; override;
     procedure OnPresent; override;
     procedure OnNext; override;
     procedure OnNext; override;
@@ -68,11 +67,8 @@ begin
 end;
 end;
 
 
 procedure TWIZEnlistAccountForSale_EnterSaleAmount.OnNext;
 procedure TWIZEnlistAccountForSale_EnterSaleAmount.OnNext;
-var
-  amount: int64;
 begin
 begin
   Model.Payload.HasPayload := chkAttachPayload.Checked;
   Model.Payload.HasPayload := chkAttachPayload.Checked;
-  TAccountComp.TxtToMoney(edtAmt.Text, Model.EnlistAccountForSale.SalePrice);
 
 
   if chkChooseFee.Checked then
   if chkChooseFee.Checked then
     UpdatePath(ptInject, [TWIZOperationFee_Custom])
     UpdatePath(ptInject, [TWIZOperationFee_Custom])
@@ -94,24 +90,26 @@ end;
 
 
 function TWIZEnlistAccountForSale_EnterSaleAmount.Validate(out message: ansistring): boolean;
 function TWIZEnlistAccountForSale_EnterSaleAmount.Validate(out message: ansistring): boolean;
 var
 var
-  amount: int64;
+  LSaleAmount: int64;
 begin
 begin
   Result := True;
   Result := True;
 
 
-  if not TAccountComp.TxtToMoney(edtAmt.Text, amount) then
+  if not TAccountComp.TxtToMoney(edtAmt.Text, LSaleAmount) then
   begin
   begin
-    message := 'Invalid amount (' + edtAmt.Text + ')';
+    message := Format('Invalid Amount "%s"', [edtAmt.Text]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  if amount < 1 then
+  if LSaleAmount < 1 then
   begin
   begin
-    message := 'Invalid amount (' + edtAmt.Text + '), you must sell for an amount greater than zero';
+    message := 'You Must Sell For An Amount Greater Than Zero.';
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
+  Model.EnlistAccountForSale.SalePrice := LSaleAmount;
+
 end;
 end;
 
 
 end.
 end.

+ 38 - 36
src/gui/wizards/operations/UWIZEnlistAccountForSale_EnterSeller.pas

@@ -33,6 +33,7 @@ type
     procedure btnSearchClick(Sender: TObject);
     procedure btnSearchClick(Sender: TObject);
     procedure edtSellerAccChange(Sender: TObject);
     procedure edtSellerAccChange(Sender: TObject);
     procedure UpdateUI();
     procedure UpdateUI();
+
   public
   public
     procedure OnPresent; override;
     procedure OnPresent; override;
     procedure OnNext; override;
     procedure OnNext; override;
@@ -56,19 +57,21 @@ end;
 
 
 procedure TWIZEnlistAccountForSale_EnterSeller.UpdateUI();
 procedure TWIZEnlistAccountForSale_EnterSeller.UpdateUI();
 var
 var
-  LAcc: TAccount;
-  LAccNo: cardinal;
+  LAccount: TAccount;
+  LAccountNumber: cardinal;
 begin
 begin
-  if TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, LAccNo) then begin
-    if (LAccNo < 0) or (LAccNo >= TNode.Node.Bank.AccountsCount) then begin
+  if TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, LAccountNumber) then
+    if (LAccountNumber < 0) or (LAccountNumber >= TNode.Node.Bank.AccountsCount) then
+    begin
       lblSellerAccount.Caption := '';
       lblSellerAccount.Caption := '';
       lblSellerAccount.Visible := False;
       lblSellerAccount.Visible := False;
-    end else begin
-      LAcc := TNode.Node.Operations.SafeBoxTransaction.account(LAccNo);
-      lblSellerAccount.Caption := LAcc.DisplayString;
+    end
+    else
+    begin
+      LAccount := TNode.Node.Operations.SafeBoxTransaction.account(LAccountNumber);
+      lblSellerAccount.Caption := LAccount.DisplayString;
       lblSellerAccount.Visible := True;
       lblSellerAccount.Visible := True;
     end;
     end;
-  end;
 end;
 end;
 
 
 procedure TWIZEnlistAccountForSale_EnterSeller.OnPresent;
 procedure TWIZEnlistAccountForSale_EnterSeller.OnPresent;
@@ -79,66 +82,65 @@ end;
 
 
 procedure TWIZEnlistAccountForSale_EnterSeller.btnSearchClick(Sender: TObject);
 procedure TWIZEnlistAccountForSale_EnterSeller.btnSearchClick(Sender: TObject);
 var
 var
-  F: TFRMAccountSelect;
-  c: cardinal;
+  LFRMAccountSelect: TFRMAccountSelect;
+  LAccountNumber: cardinal;
 begin
 begin
-  F := TFRMAccountSelect.Create(Self);
-  F.Position := poMainFormCenter;
+  LFRMAccountSelect := TFRMAccountSelect.Create(Self);
+  LFRMAccountSelect.Position := poMainFormCenter;
   try
   try
-    F.Node := TNode.Node;
-    F.WalletKeys := TWallet.Keys;
-    F.Filters := edtSellerAcc.Tag;
-    if TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, c) then
-      F.DefaultAccount := c;
-    F.AllowSelect := True;
-    if F.ShowModal = mrOk then
-      edtSellerAcc.Text := TAccountComp.AccountNumberToAccountTxtNumber(F.GetSelected);
+    LFRMAccountSelect.Node := TNode.Node;
+    LFRMAccountSelect.WalletKeys := TWallet.Keys;
+    LFRMAccountSelect.Filters := edtSellerAcc.Tag;
+    if TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, LAccountNumber) then
+      LFRMAccountSelect.DefaultAccount := LAccountNumber;
+    LFRMAccountSelect.AllowSelect := True;
+    if LFRMAccountSelect.ShowModal = mrOk then
+      edtSellerAcc.Text := TAccountComp.AccountNumberToAccountTxtNumber(LFRMAccountSelect.GetSelected);
   finally
   finally
-    F.Free;
+    LFRMAccountSelect.Free;
   end;
   end;
 end;
 end;
 
 
 
 
 procedure TWIZEnlistAccountForSale_EnterSeller.OnNext;
 procedure TWIZEnlistAccountForSale_EnterSeller.OnNext;
 var
 var
-  c: cardinal;
-  aa: TAccount;
+  LAccountNumber: cardinal;
+  LAccount: TAccount;
 begin
 begin
-  TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, c);
-  Model.SendPASC.DestinationAccount := TNode.Node.Operations.SafeBoxTransaction.account(c);
+  TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, LAccountNumber);
+  Model.SendPASC.DestinationAccount := TNode.Node.Operations.SafeBoxTransaction.account(LAccountNumber);
 end;
 end;
 
 
 function TWIZEnlistAccountForSale_EnterSeller.Validate(out message: ansistring): boolean;
 function TWIZEnlistAccountForSale_EnterSeller.Validate(out message: ansistring): boolean;
 var
 var
-  i: integer;
-  c: cardinal;
+  LIdx: integer;
+  LAccountNumber: cardinal;
 begin
 begin
   Result := True;
   Result := True;
 
 
-  if not (TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, c)) then
+  if not (TAccountComp.AccountTxtNumberToAccountNumber(edtSellerAcc.Text, LAccountNumber)) then
   begin
   begin
-    message := 'Invalid seller account (' + edtSellerAcc.Text + ')';
+    message := Format('Invalid Seller Account "%s"', [edtSellerAcc.Text]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  if (c < 0) or (c >= TNode.Node.Bank.AccountsCount) then
+  if (LAccountNumber < 0) or (LAccountNumber >= TNode.Node.Bank.AccountsCount) then
   begin
   begin
-    message := 'Invalid seller account (' +
-      TAccountComp.AccountNumberToAccountTxtNumber(c) + ')';
+    message := Format('Invalid Seller Account "%s"', [TAccountComp.AccountNumberToAccountTxtNumber(LAccountNumber)]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-    if (Model.Account.SelectedAccounts[i].Account = c) then
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    if (Model.Account.SelectedAccounts[LIdx].Account = LAccountNumber) then
     begin
     begin
-      message := 'Seller account cannot be same account';
+      message := 'Seller Account Cannot Be Same As Account To Be Sold.';
       Result := False;
       Result := False;
       Exit;
       Exit;
     end;
     end;
 
 
-  Model.EnlistAccountForSale.SellerAccount := TNode.Node.Operations.SafeBoxTransaction.account(c);
+  Model.EnlistAccountForSale.SellerAccount := TNode.Node.Operations.SafeBoxTransaction.account(LAccountNumber);
 
 
 end;
 end;
 
 

+ 10 - 10
src/gui/wizards/operations/UWIZOperationConfirmation.pas

@@ -66,7 +66,7 @@ type
 
 
 procedure TWIZOperationConfirmation.OnPresent;
 procedure TWIZOperationConfirmation.OnPresent;
 var
 var
-  Data: TOperationConfirmationDataSource;
+  LData: TOperationConfirmationDataSource;
 begin
 begin
   FConfirmationGrid := TVisualGrid.Create(Self);
   FConfirmationGrid := TVisualGrid.Create(Self);
   FConfirmationGrid.CanSearch := False;
   FConfirmationGrid.CanSearch := False;
@@ -120,9 +120,9 @@ begin
     DataAlignment := taRightJustify;
     DataAlignment := taRightJustify;
   end;
   end;
 
 
-  Data := TOperationConfirmationDataSource.Create(FConfirmationGrid);
-  Data.Model := Model;
-  FConfirmationGrid.DataSource := Data;
+  LData := TOperationConfirmationDataSource.Create(FConfirmationGrid);
+  LData.Model := Model;
+  FConfirmationGrid.DataSource := LData;
   paGrid.AddControlDockCenter(FConfirmationGrid);
   paGrid.AddControlDockCenter(FConfirmationGrid);
   lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
   lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
   if not (Model.ExecuteOperationType = omtEnlistAccountForSale) then
   if not (Model.ExecuteOperationType = omtEnlistAccountForSale) then
@@ -141,10 +141,10 @@ end;
 
 
 procedure TWIZOperationConfirmation.OnNext;
 procedure TWIZOperationConfirmation.OnNext;
 var
 var
-  locked: boolean;
+  LLocked: boolean;
 begin
 begin
-  locked := (not TWallet.Keys.HasPassword) or (not TWallet.Keys.IsValidPassword);
-  if locked then
+  LLocked := (not TWallet.Keys.HasPassword) or (not TWallet.Keys.IsValidPassword);
+  if LLocked then
     TUserInterface.UnlockWallet(Self);
     TUserInterface.UnlockWallet(Self);
 end;
 end;
 
 
@@ -231,10 +231,10 @@ end;
 
 
 procedure TOperationConfirmationDataSource.FetchAll(const AContainer: TList<TAccount>);
 procedure TOperationConfirmationDataSource.FetchAll(const AContainer: TList<TAccount>);
 var
 var
-  i: integer;
+  LIdx: integer;
 begin
 begin
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-    AContainer.Add(Model.Account.SelectedAccounts[i]);
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    AContainer.Add(Model.Account.SelectedAccounts[LIdx]);
 end;
 end;
 
 
 
 

+ 11 - 13
src/gui/wizards/operations/UWIZOperationFee_Custom.pas

@@ -36,8 +36,6 @@ type
     procedure fseFeeChange(Sender: TObject);
     procedure fseFeeChange(Sender: TObject);
 
 
 
 
-
-
   public
   public
     procedure OnPresent; override;
     procedure OnPresent; override;
     procedure OnNext; override;
     procedure OnNext; override;
@@ -56,10 +54,10 @@ uses
 
 
 procedure TWIZOperationFee_Custom.UpdateUI();
 procedure TWIZOperationFee_Custom.UpdateUI();
 var
 var
-  opfee: int64;
+  LOperationFee: int64;
 begin
 begin
-  TAccountComp.TxtToMoney(Trim(fseFee.ValueToStr(fseFee.Value)), opfee);
-  lblTotalFeeValue.Caption := Format('%s PASC', [TAccountComp.FormatMoney(opfee * Length(Model.Account.SelectedAccounts))]);
+  TAccountComp.TxtToMoney(Trim(fseFee.ValueToStr(fseFee.Value)), LOperationFee);
+  lblTotalFeeValue.Caption := Format('%s PASC', [TAccountComp.FormatMoney(LOperationFee * Length(Model.Account.SelectedAccounts))]);
 end;
 end;
 
 
 procedure TWIZOperationFee_Custom.fseFeeChange(Sender: TObject);
 procedure TWIZOperationFee_Custom.fseFeeChange(Sender: TObject);
@@ -88,25 +86,24 @@ end;
 
 
 function TWIZOperationFee_Custom.Validate(out message: ansistring): boolean;
 function TWIZOperationFee_Custom.Validate(out message: ansistring): boolean;
 var
 var
-  opfee: int64;
-  i: integer;
-  acc: TAccount;
+  LOperationFee: int64;
+  LAccount: TAccount;
 begin
 begin
   Result := True;
   Result := True;
 
 
-  if not TAccountComp.TxtToMoney(Trim(fseFee.ValueToStr(fseFee.Value)), opfee) then
+  if not TAccountComp.TxtToMoney(Trim(fseFee.ValueToStr(fseFee.Value)), LOperationFee) then
   begin
   begin
-    message := 'Invalid fee value "' + fseFee.ValueToStr(fseFee.Value) + '"';
+    message := Format('Invalid Fee Value "%s"', [fseFee.ValueToStr(fseFee.Value)]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  Model.Fee.SingleOperationFee := opfee;
+  Model.Fee.SingleOperationFee := LOperationFee;
 
 
   if Length(Model.Account.SelectedAccounts) > 1 then
   if Length(Model.Account.SelectedAccounts) > 1 then
     if not (Model.Fee.SingleOperationFee > 0) then
     if not (Model.Fee.SingleOperationFee > 0) then
     begin
     begin
-      message := 'zero fee only allowed for single operations.';
+      message := 'Zero Fee Is Only Allowed For Single Operations.';
       Result := False;
       Result := False;
       Exit;
       Exit;
     end;
     end;
@@ -117,8 +114,9 @@ begin
 
 
   if Length(Model.Signer.SignerCandidates) < 1 then
   if Length(Model.Signer.SignerCandidates) < 1 then
   begin
   begin
+    message := 'No Valid Signer Account Was Found With The Current Requirements.';
     Result := False;
     Result := False;
-    message := 'no valid signer account was found with the current requirements.';
+    Exit;
   end;
   end;
 
 
 end;
 end;

+ 1 - 1
src/gui/wizards/operations/UWIZOperationPayload_Content.pas

@@ -67,7 +67,7 @@ begin
   Result := True;
   Result := True;
   if Length(mmoPayload.Lines.Text) > CT_MaxPayloadSize then
   if Length(mmoPayload.Lines.Text) > CT_MaxPayloadSize then
   begin
   begin
-    message := 'Payload is Larger than Max Payload Size "255"';
+    message := Format('Payload Size Is Larger Than Max Payload Size Which Is "%u"', [CT_MaxPayloadSize]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;

+ 1 - 1
src/gui/wizards/operations/UWIZOperationPayload_Encryption.pas

@@ -90,7 +90,7 @@ begin
   if (not rbNotEncrypted.Checked) and (not rbEncryptedWithSender.Checked) and
   if (not rbNotEncrypted.Checked) and (not rbEncryptedWithSender.Checked) and
     (not rbEncryptedWithRecipient.Checked) and (not rbEncryptedWithPassword.Checked) then
     (not rbEncryptedWithRecipient.Checked) and (not rbEncryptedWithPassword.Checked) then
   begin
   begin
-    message := 'you must select an encryption option for payload';
+    message := 'You Must Select An Encryption Option For Payload';
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;

+ 1 - 1
src/gui/wizards/operations/UWIZOperationPayload_Password.pas

@@ -68,7 +68,7 @@ begin
   Result := True;
   Result := True;
   if Length(Trim(edtPassword.Text)) = 0 then
   if Length(Trim(edtPassword.Text)) = 0 then
   begin
   begin
-    message := 'password cannot be empty';
+    message := 'Password Cannot Be Empty';
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;

+ 24 - 21
src/gui/wizards/operations/UWIZOperationSelected.pas

@@ -59,10 +59,10 @@ type
 
 
 procedure TWIZOperationSelected.OnPresent;
 procedure TWIZOperationSelected.OnPresent;
 var
 var
-  Data: TOperationSelectedDataSource;
-  i: integer;
-  acc: TAccount;
-  totalBalance: int64;
+  LData: TOperationSelectedDataSource;
+  LIdx: integer;
+  LAccount: TAccount;
+  LTotalBalance: int64;
 begin
 begin
   FSelectedAccountsGrid := TVisualGrid.Create(Self);
   FSelectedAccountsGrid := TVisualGrid.Create(Self);
   FSelectedAccountsGrid.CanSearch := False;
   FSelectedAccountsGrid.CanSearch := False;
@@ -93,37 +93,40 @@ begin
     Renderer := TCellRenderers.PASC;
     Renderer := TCellRenderers.PASC;
     Filters := SORTABLE_NUMERIC_FILTER;
     Filters := SORTABLE_NUMERIC_FILTER;
   end;
   end;
-  Data := TOperationSelectedDataSource.Create(FSelectedAccountsGrid);
-  Data.Model := Model;
-  FSelectedAccountsGrid.DataSource := Data;
+  LData := TOperationSelectedDataSource.Create(FSelectedAccountsGrid);
+  LData.Model := Model;
+  FSelectedAccountsGrid.DataSource := LData;
   paGrid.AddControlDockCenter(FSelectedAccountsGrid);
   paGrid.AddControlDockCenter(FSelectedAccountsGrid);
 
 
-  totalBalance := 0;
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+  LTotalBalance := 0;
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
   begin
   begin
-    acc := Model.Account.SelectedAccounts[i];
-    totalBalance := totalBalance + acc.balance;
+    LAccount := Model.Account.SelectedAccounts[LIdx];
+    LTotalBalance := LTotalBalance + LAccount.balance;
   end;
   end;
 
 
   lblTotalBalanceValue.Caption :=
   lblTotalBalanceValue.Caption :=
-    Format('%s PASC', [TAccountComp.FormatMoney(totalBalance)]);
+    Format('%s PASC', [TAccountComp.FormatMoney(LTotalBalance)]);
 end;
 end;
 
 
 function TWIZOperationSelected.Validate(out message: ansistring): boolean;
 function TWIZOperationSelected.Validate(out message: ansistring): boolean;
 var
 var
-  i: integer;
+  LIdx: integer;
+  LAccount: TAccount;
 begin
 begin
   Result := True;
   Result := True;
 
 
   if Model.ExecuteOperationType = omtEnlistAccountForSale then
   if Model.ExecuteOperationType = omtEnlistAccountForSale then
-    for i := Low(model.Account.SelectedAccounts) to High(model.Account.SelectedAccounts) do
-      if TAccountComp.IsAccountForSale(model.Account.SelectedAccounts[i].accountInfo) then
+    for LIdx := Low(model.Account.SelectedAccounts) to High(model.Account.SelectedAccounts) do
+    begin
+      LAccount := model.Account.SelectedAccounts[LIdx];
+      if TAccountComp.IsAccountForSale(LAccount.accountInfo) then
       begin
       begin
         Result := False;
         Result := False;
-        message := 'Account ' + TAccountComp.AccountNumberToAccountTxtNumber(
-          model.Account.SelectedAccounts[i].account) + ' is already enlisted for sale';
+        message := Format('Account "%s" Is Already Enlisted For Sale', [LAccount.AccountString]);
         Exit;
         Exit;
       end;
       end;
+    end;
 
 
   // get signer accounts from selected accounts
   // get signer accounts from selected accounts
   Model.Signer.SignerCandidates := TCoreTool.GetSignerCandidates(Length(Model.Account.SelectedAccounts), Model.Fee.SingleOperationFee, Model.Account.SelectedAccounts);
   Model.Signer.SignerCandidates := TCoreTool.GetSignerCandidates(Length(Model.Account.SelectedAccounts), Model.Fee.SingleOperationFee, Model.Account.SelectedAccounts);
@@ -131,7 +134,7 @@ begin
   if Length(Model.Signer.SignerCandidates) < 1 then
   if Length(Model.Signer.SignerCandidates) < 1 then
   begin
   begin
     Result := False;
     Result := False;
-    message := 'no valid signer account was found.';
+    message := 'No Valid Signer Account Was Found.';
   end;
   end;
 
 
 end;
 end;
@@ -140,10 +143,10 @@ end;
 
 
 procedure TOperationSelectedDataSource.FetchAll(const AContainer: TList<TAccount>);
 procedure TOperationSelectedDataSource.FetchAll(const AContainer: TList<TAccount>);
 var
 var
-  i: integer;
+  LIdx: integer;
 begin
 begin
-  for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
-    AContainer.Add(Model.Account.SelectedAccounts[i]);
+  for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    AContainer.Add(Model.Account.SelectedAccounts[LIdx]);
 
 
 end;
 end;
 
 

+ 9 - 9
src/gui/wizards/operations/UWIZOperationSigner_Select.pas

@@ -67,25 +67,25 @@ end;
 
 
 procedure TWIZOperationSigner_Select.OnPresent;
 procedure TWIZOperationSigner_Select.OnPresent;
 
 
-  function GetAccNoWithChecksum(AAccountNumber: cardinal): string;
+  function GetAccountNumberWithChecksum(AAccountNumber: cardinal): string;
   begin
   begin
     Result := TAccountComp.AccountNumberToAccountTxtNumber(AAccountNumber);
     Result := TAccountComp.AccountNumberToAccountTxtNumber(AAccountNumber);
   end;
   end;
 
 
 var
 var
-  acc: TAccount;
-  accNumberwithChecksum: string;
-  i: integer;
+  LAccount: TAccount;
+  LAccountNumberWithChecksum: string;
+  LIdx: integer;
 begin
 begin
   cbSignerAccount.Items.BeginUpdate;
   cbSignerAccount.Items.BeginUpdate;
   try
   try
     cbSignerAccount.Items.Clear;
     cbSignerAccount.Items.Clear;
     cbSignerAccount.Items.Add('Select Signer Account');
     cbSignerAccount.Items.Add('Select Signer Account');
-    for i := Low(Model.Signer.SignerCandidates) to High(Model.Signer.SignerCandidates) do
+    for LIdx := Low(Model.Signer.SignerCandidates) to High(Model.Signer.SignerCandidates) do
     begin
     begin
-      acc := Model.Signer.SignerCandidates[i];
-      accNumberwithChecksum := GetAccNoWithChecksum(acc.account);
-      cbSignerAccount.Items.AddObject(accNumberwithChecksum, TObject(i));
+      LAccount := Model.Signer.SignerCandidates[LIdx];
+      LAccountNumberWithChecksum := GetAccountNumberWithChecksum(LAccount.account);
+      cbSignerAccount.Items.AddObject(LAccountNumberWithChecksum, TObject(LIdx));
     end;
     end;
   finally
   finally
     cbSignerAccount.Items.EndUpdate;
     cbSignerAccount.Items.EndUpdate;
@@ -114,7 +114,7 @@ begin
   Result := True;
   Result := True;
   if cbSignerAccount.ItemIndex < 1 then
   if cbSignerAccount.ItemIndex < 1 then
   begin
   begin
-    message := 'A signer account must be selected';
+    message := 'A Signer Account Must Be Selected';
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;

+ 11 - 11
src/gui/wizards/operations/UWIZSendPASC_EnterQuantity.pas

@@ -115,33 +115,33 @@ end;
 
 
 function TWIZSendPASC_EnterQuantity.Validate(out message: ansistring): boolean;
 function TWIZSendPASC_EnterQuantity.Validate(out message: ansistring): boolean;
 var
 var
-  amount: int64;
-  i: integer;
-  acc: TAccount;
+  LAmount: int64;
+  LIdx: integer;
+  LAccount: TAccount;
 begin
 begin
   Result := True;
   Result := True;
   if not chkallfunds.Checked then
   if not chkallfunds.Checked then
   begin
   begin
-    if not TAccountComp.TxtToMoney(edtAmt.Text, amount) then
+    if not TAccountComp.TxtToMoney(edtAmt.Text, LAmount) then
     begin
     begin
-      message := 'Invalid amount (' + edtAmt.Text + ')';
+      message := Format('Invalid Amount "%s"', [edtAmt.Text]);
       Result := False;
       Result := False;
       Exit;
       Exit;
     end;
     end;
 
 
-    if amount < 1 then
+    if LAmount < 1 then
     begin
     begin
-      message := 'Invalid amount (' + edtAmt.Text + '), you must send an amount greater than zero';
+      message := 'You Must Send An Amount Greater Than Zero.';
       Result := False;
       Result := False;
       Exit;
       Exit;
     end;
     end;
 
 
-    for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
+    for LIdx := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
     begin
     begin
-      acc := Model.Account.SelectedAccounts[i];
-      if acc.balance < amount then
+      LAccount := Model.Account.SelectedAccounts[LIdx];
+      if LAccount.balance < LAmount then
       begin
       begin
-        message := 'Insufficient funds in one or more accounts';
+        message := 'Insufficient Funds In One Or More Accounts.';
         Result := False;
         Result := False;
         Exit;
         Exit;
       end;
       end;

+ 40 - 42
src/gui/wizards/operations/UWIZSendPASC_EnterRecipient.pas

@@ -18,7 +18,7 @@ interface
 uses
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
   ExtCtrls, Buttons, UCommon, UCommon.Collections, UWallet,
   ExtCtrls, Buttons, UCommon, UCommon.Collections, UWallet,
-  UFRMAccountSelect, UNode, UWizard, UWIZSendPASC, UWIZSendPASC_EnterQuantity, UDataObjects;
+  UFRMAccountSelect, UNode, UWizard, UWIZSendPASC, UWIZSendPASC_EnterQuantity, UCoreUtils, UDataObjects;
 
 
 type
 type
 
 
@@ -38,7 +38,6 @@ type
     procedure UpdateUI();
     procedure UpdateUI();
 
 
 
 
-
   public
   public
     procedure OnPresent; override;
     procedure OnPresent; override;
     procedure OnNext; override;
     procedure OnNext; override;
@@ -62,25 +61,25 @@ end;
 
 
 procedure TWIZSendPASC_EnterRecipient.UpdateUI();
 procedure TWIZSendPASC_EnterRecipient.UpdateUI();
 var
 var
-  tempAcc: TAccount;
-  c: cardinal;
+  LTempAccount: TAccount;
+  LAccountNumber: cardinal;
 begin
 begin
-  if TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, c) then
+  if TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, LAccountNumber) then
   begin
   begin
-    if (c < 0) or (c >= TNode.Node.Bank.AccountsCount) then
+    if (LAccountNumber < 0) or (LAccountNumber >= TNode.Node.Bank.AccountsCount) then
     begin
     begin
-      lblDestAccNumberValue.Caption := 'unknown';
-      lblDestAccNumberNameValue.Caption := 'unknown';
+      lblDestAccNumberValue.Caption := 'Unknown';
+      lblDestAccNumberNameValue.Caption := 'Unknown';
       Exit;
       Exit;
     end;
     end;
-    tempAcc := TNode.Node.Operations.SafeBoxTransaction.account(c);
+    LTempAccount := TNode.Node.Operations.SafeBoxTransaction.account(LAccountNumber);
     lblDestAccNumberValue.Caption := edtDestAcc.Text;
     lblDestAccNumberValue.Caption := edtDestAcc.Text;
-    lblDestAccNumberNameValue.Caption := tempAcc.Name;
+    lblDestAccNumberNameValue.Caption := LTempAccount.Name;
   end
   end
   else
   else
   begin
   begin
-    lblDestAccNumberValue.Caption := 'unknown';
-    lblDestAccNumberNameValue.Caption := 'unknown';
+    lblDestAccNumberValue.Caption := 'Unknown';
+    lblDestAccNumberNameValue.Caption := 'Unknown';
   end;
   end;
 
 
 end;
 end;
@@ -93,71 +92,70 @@ end;
 
 
 procedure TWIZSendPASC_EnterRecipient.btnSearchClick(Sender: TObject);
 procedure TWIZSendPASC_EnterRecipient.btnSearchClick(Sender: TObject);
 var
 var
-  F: TFRMAccountSelect;
-  c: cardinal;
+  LFRMAccountSelect: TFRMAccountSelect;
+  LAccountNumber: cardinal;
 begin
 begin
-  F := TFRMAccountSelect.Create(Self);
-  F.Position := poMainFormCenter;
+  LFRMAccountSelect := TFRMAccountSelect.Create(Self);
+  LFRMAccountSelect.Position := poMainFormCenter;
   try
   try
-    F.Node := TNode.Node;
-    F.WalletKeys := TWallet.Keys;
-    F.Filters := edtDestAcc.Tag;
-    if TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, c) then
-      F.DefaultAccount := c;
-    F.AllowSelect := True;
-    if F.ShowModal = mrOk then
-      edtDestAcc.Text := TAccountComp.AccountNumberToAccountTxtNumber(F.GetSelected);
+    LFRMAccountSelect.Node := TNode.Node;
+    LFRMAccountSelect.WalletKeys := TWallet.Keys;
+    LFRMAccountSelect.Filters := edtDestAcc.Tag;
+    if TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, LAccountNumber) then
+      LFRMAccountSelect.DefaultAccount := LAccountNumber;
+    LFRMAccountSelect.AllowSelect := True;
+    if LFRMAccountSelect.ShowModal = mrOk then
+      edtDestAcc.Text := TAccountComp.AccountNumberToAccountTxtNumber(LFRMAccountSelect.GetSelected);
   finally
   finally
-    F.Free;
+    LFRMAccountSelect.Free;
   end;
   end;
 end;
 end;
 
 
 
 
 procedure TWIZSendPASC_EnterRecipient.OnNext;
 procedure TWIZSendPASC_EnterRecipient.OnNext;
 var
 var
-  c: cardinal;
-  aa: TAccount;
+  LAccountNumber: cardinal;
+  LAccount: TAccount;
 begin
 begin
-  TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, c);
-  Model.SendPASC.DestinationAccount := TNode.Node.Operations.SafeBoxTransaction.account(c);
+  TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, LAccountNumber);
+  Model.SendPASC.DestinationAccount := TNode.Node.Operations.SafeBoxTransaction.account(LAccountNumber);
   UpdatePath(ptInject, [TWIZSendPASC_EnterQuantity]);
   UpdatePath(ptInject, [TWIZSendPASC_EnterQuantity]);
 
 
 end;
 end;
 
 
 function TWIZSendPASC_EnterRecipient.Validate(out message: ansistring): boolean;
 function TWIZSendPASC_EnterRecipient.Validate(out message: ansistring): boolean;
 
 
-  function GetAccNoWithChecksum(constref AAccount: TAccount): string;
+  function GetAccountNumberWithChecksum(constref AAccount: TAccount): string;
   begin
   begin
-    Result := TAccountComp.AccountNumberToAccountTxtNumber(AAccount.account);
+    Result := AAccount.AccountString;
   end;
   end;
 
 
 var
 var
-  AccountNumbersWithChecksum: TArray<string>;
-  c: cardinal;
+  LAccountNumbersWithChecksum: TArray<string>;
+  LAccountNumber: cardinal;
 begin
 begin
   Result := True;
   Result := True;
 
 
-  if not (TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, c)) then
+  if not (TAccountComp.AccountTxtNumberToAccountNumber(edtDestAcc.Text, LAccountNumber)) then
   begin
   begin
-    message := 'Invalid destination account (' + edtDestAcc.Text + ')';
+    message := Format('Invalid Destination Account "%s"', [edtDestAcc.Text]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  if (c < 0) or (c >= TNode.Node.Bank.AccountsCount) then
+  if (LAccountNumber < 0) or (LAccountNumber >= TNode.Node.Bank.AccountsCount) then
   begin
   begin
-    message := 'Invalid destination account (' +
-      TAccountComp.AccountNumberToAccountTxtNumber(c) + ')';
+    message := Format('Invalid Destination Account "%s"', [TAccountComp.AccountNumberToAccountTxtNumber(LAccountNumber)]);
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;
 
 
-  AccountNumbersWithChecksum :=
-    TListTool<TAccount, string>.Transform(Model.Account.SelectedAccounts, GetAccNoWithCheckSum);
+  LAccountNumbersWithChecksum :=
+    TListTool<TAccount, string>.Transform(Model.Account.SelectedAccounts, GetAccountNumberWithChecksum);
 
 
-  if TArrayTool<string>.Contains(AccountNumbersWithChecksum, edtDestAcc.Text) then
+  if TArrayTool<string>.Contains(LAccountNumbersWithChecksum, edtDestAcc.Text) then
   begin
   begin
-    message := 'Sender and destination account are the same';
+    message := 'Sender And Destination Account Are Same';
     Result := False;
     Result := False;
     Exit;
     Exit;
   end;
   end;