Browse Source

Merge pull request #210 from PascalCoin/master

Pull to PascalCoinDev
Pascal Coin 4 years ago
parent
commit
271d1ea400
34 changed files with 243 additions and 165 deletions
  1. 3 0
      src/core/UEncoding.pas
  2. 1 1
      src/core/UOpTransaction.pas
  3. 18 18
      src/gui-experimental/UCTRLWallet.lfm
  4. 1 1
      src/gui-experimental/UCTRLWallet.pas
  5. 31 31
      src/gui-experimental/UFRMAccountExplorer.lfm
  6. 1 1
      src/gui-experimental/UFRMAccountExplorer.pas
  7. 4 4
      src/gui-experimental/UFRMAccountSelect.pas
  8. 23 13
      src/gui-experimental/UFRMOperation.pas
  9. 8 2
      src/gui-experimental/UFRMPascalCoinWalletConfig.pas
  10. 2 2
      src/gui-experimental/UFRMPayloadDecoder.pas
  11. 6 6
      src/gui-experimental/UUserInterface.pas
  12. 59 39
      src/gui-experimental/core.utils/UCoreUtils.pas
  13. 4 4
      src/gui-experimental/core.utils/UDataSources.pas
  14. 1 0
      src/gui-experimental/wizards/operations/UWIZBuyAccount_Details.pas
  15. 1 0
      src/gui-experimental/wizards/operations/UWIZChangeAccountInfo.pas
  16. 18 18
      src/gui-experimental/wizards/operations/UWIZChangeAccountInfo_Details.lfm
  17. 1 0
      src/gui-experimental/wizards/operations/UWIZChangeAccountInfo_Details.pas
  18. 1 1
      src/gui-experimental/wizards/operations/UWIZChangeKey.pas
  19. 1 0
      src/gui-experimental/wizards/operations/UWIZChangeKey_EnterKey.pas
  20. 1 0
      src/gui-experimental/wizards/operations/UWIZChangeKey_SelectKey.pas
  21. 1 0
      src/gui-experimental/wizards/operations/UWIZEnlistAccountForSale.pas
  22. 1 0
      src/gui-experimental/wizards/operations/UWIZEnlistAccountForSale_EnterSeller.pas
  23. 1 1
      src/gui-experimental/wizards/operations/UWIZOperation.pas
  24. 1 0
      src/gui-experimental/wizards/operations/UWIZOperationConfirmation.pas
  25. 1 0
      src/gui-experimental/wizards/operations/UWIZOperationFee_Custom.pas
  26. 1 0
      src/gui-experimental/wizards/operations/UWIZOperationSelected.pas
  27. 1 0
      src/gui-experimental/wizards/operations/UWIZOperationSigner_Select.pas
  28. 1 0
      src/gui-experimental/wizards/operations/UWIZSendPASC_Details.pas
  29. 2 1
      src/gui-experimental/wizards/wallet/UWIZAddKey_ImportPubKey.pas
  30. 3 2
      src/libraries/sphere10/UCommon.Collections.pas
  31. 13 2
      src/libraries/sphere10/UCommon.Data.pas
  32. 14 12
      src/libraries/sphere10/UWizard.pas
  33. BIN
      src/pascalcoin_wallet_classic.res
  34. 18 6
      src/pascalcoin_wallet_experimental.lpi

+ 3 - 0
src/core/UEncoding.pas

@@ -195,6 +195,9 @@ var
   i: Int32;
 begin
   Result := #0;
+  // carefull: E:\SourceCode\PascalCoin-master\src\libraries\regex must be added to project file
+  // otherwise wrong unit will be used from:
+  // Drive:\Tools\Lazarus\fpc\3.2.0\source\packages\regexpr\src
   i := FRegex.MatchIndexFromName(AGroupName);
   if i >= 0 then begin
     Result := FRegex.Match[i];

+ 1 - 1
src/core/UOpTransaction.pas

@@ -32,7 +32,7 @@ Uses UCrypto, UBlockChain, Classes, UAccounts, UBaseTypes,
 Type
   // Operations Type
   TOpTransactionStyle = (transaction, transaction_with_auto_buy_account, buy_account, transaction_with_auto_atomic_swap);
-    // transaction = Sinlge standard transaction
+    // transaction = Single standard transaction
     // transaction_with_auto_buy_account = Single transaction made over an account listed for private sale. For STORING purposes only
     // buy_account = A Buy account operation
     // transaction_with_auto_atomic_swap = Single transaction made over an account listed for atomic swap (coin swap or account swap)

+ 18 - 18
src/gui-experimental/UCTRLWallet.lfm

@@ -10,7 +10,7 @@ object CTRLWallet: TCTRLWallet
   ClientWidth = 1151
   OnCreate = FormCreate
   OnResize = FormResize
-  LCLVersion = '2.0.2.0'
+  LCLVersion = '2.0.10.0'
   object PairSplitter1: TPairSplitter
     Cursor = crDefault
     Left = 0
@@ -34,14 +34,14 @@ object CTRLWallet: TCTRLWallet
         Width = 344
         Anchors = [akTop, akLeft, akRight]
         Caption = 'Overview'
-        ClientHeight = 85
+        ClientHeight = 86
         ClientWidth = 340
         TabOrder = 0
         object Label1: TLabel
           Left = 16
-          Height = 15
+          Height = 14
           Top = 16
-          Width = 58
+          Width = 68
           Caption = 'Total PASC'
           Font.Style = [fsBold]
           ParentColor = False
@@ -49,9 +49,9 @@ object CTRLWallet: TCTRLWallet
         end
         object Label2: TLabel
           Left = 16
-          Height = 15
+          Height = 14
           Top = 48
-          Width = 59
+          Width = 69
           Caption = 'Total PASA'
           Font.Style = [fsBold]
           ParentColor = False
@@ -91,16 +91,16 @@ object CTRLWallet: TCTRLWallet
         Width = 344
         Anchors = [akTop, akLeft, akRight, akBottom]
         Caption = 'My Accounts'
-        ClientHeight = 420
+        ClientHeight = 421
         ClientWidth = 340
         TabOrder = 1
         object cbAccounts: TComboBox
           Left = 8
-          Height = 23
+          Height = 22
           Top = 8
           Width = 320
           Anchors = [akTop, akLeft, akRight]
-          ItemHeight = 15
+          ItemHeight = 14
           ItemIndex = 0
           Items.Strings = (
             'Show All'
@@ -114,7 +114,7 @@ object CTRLWallet: TCTRLWallet
         end
         object paAccounts: TPanel
           Left = 8
-          Height = 376
+          Height = 377
           Top = 40
           Width = 320
           Anchors = [akTop, akLeft, akRight, akBottom]
@@ -141,12 +141,12 @@ object CTRLWallet: TCTRLWallet
         Width = 776
         Anchors = [akTop, akLeft, akRight, akBottom]
         Caption = 'Recent Operations'
-        ClientHeight = 532
+        ClientHeight = 533
         ClientWidth = 772
         TabOrder = 0
         object paOperations: TPanel
           Left = 8
-          Height = 512
+          Height = 513
           Top = 16
           Width = 760
           Anchors = [akTop, akLeft, akRight, akBottom]
@@ -160,8 +160,8 @@ object CTRLWallet: TCTRLWallet
     end
   end
   object mnuAccountsPopup: TPopupMenu
-    left = 768
-    top = 64
+    Left = 768
+    Top = 64
     object miSendPASC: TMenuItem
       Caption = 'Send PASC'
       OnClick = miSendPASCClick
@@ -198,8 +198,8 @@ object CTRLWallet: TCTRLWallet
     end
   end
   object mnuOperationsPopup: TPopupMenu
-    left = 896
-    top = 64
+    Left = 896
+    Top = 64
     object miCopyOphash: TMenuItem
       Caption = 'Copy OPHASH'
       OnClick = miCopyOphashClick
@@ -213,7 +213,7 @@ object CTRLWallet: TCTRLWallet
     end
   end
   object mnuFirstAccountPopup: TPopupMenu
-    left = 1024
-    top = 64
+    Left = 1024
+    Top = 64
   end
 end

+ 1 - 1
src/gui-experimental/UCTRLWallet.pas

@@ -21,7 +21,7 @@ interface
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus,
   ExtCtrls, PairSplitter, Buttons, UVisualGrid, UCommon, UCommon.UI, Generics.Collections,
-  ULog, UAccounts, UDataSources, UNode, UCoreObjects, UCoreUtils, UCTRLNoAccount;
+  ULog, UAccounts, UPCDataTypes, UDataSources, UNode, UCoreObjects, UCoreUtils, UCTRLNoAccount;
 
 type
 

+ 31 - 31
src/gui-experimental/UFRMAccountExplorer.lfm

@@ -5,16 +5,16 @@ object FRMAccountExplorer: TFRMAccountExplorer
   Width = 868
   ActiveControl = cbMyPrivateKeys
   Caption = 'Accounts Explorer'
-  ClientHeight = 431
+  ClientHeight = 432
   ClientWidth = 868
   Menu = meAccountExplorerMenu
   OnCreate = FormCreate
   OnDestroy = FormDestroy
   Position = poOwnerFormCenter
-  LCLVersion = '2.0.2.0'
+  LCLVersion = '2.0.10.0'
   object Splitter1: TSplitter
     Left = 380
-    Height = 385
+    Height = 366
     Top = 66
     Width = 5
   end
@@ -30,34 +30,34 @@ object FRMAccountExplorer: TFRMAccountExplorer
     TabOrder = 0
     object Label18: TLabel
       Left = 11
-      Height = 15
+      Height = 14
       Top = 40
-      Width = 69
+      Width = 70
       Caption = 'Find account'
       ParentColor = False
     end
     object cbMyPrivateKeys: TComboBox
       Left = 308
-      Height = 23
+      Height = 22
       Top = 5
       Width = 411
-      ItemHeight = 15
+      ItemHeight = 14
       OnChange = cbMyPrivateKeysChange
       Style = csDropDownList
       TabOrder = 0
     end
     object cbExploreMyAccounts: TCheckBox
       Left = 11
-      Height = 19
+      Height = 18
       Top = 9
-      Width = 255
+      Width = 268
       Caption = 'Explore accounts with one of my Wallet Keys'
       OnChange = cbExploreMyAccountsChange
       TabOrder = 1
     end
     object ebFindAccountNumber: TEdit
       Left = 95
-      Height = 23
+      Height = 22
       Top = 33
       Width = 83
       OnChange = ebFindAccountNumberChange
@@ -75,16 +75,16 @@ object FRMAccountExplorer: TFRMAccountExplorer
     end
     object cbFilterAccounts: TCheckBox
       Left = 308
-      Height = 19
+      Height = 18
       Top = 35
-      Width = 157
+      Width = 161
       Caption = 'Filter accounts by balance'
       OnChange = cbFilterAccountsChange
       TabOrder = 4
     end
     object ebFilterAccountByBalanceMin: TEdit
       Left = 472
-      Height = 23
+      Height = 22
       Hint = 'Min balance'
       Top = 33
       Width = 83
@@ -94,7 +94,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
     end
     object ebFilterAccountByBalanceMax: TEdit
       Left = 568
-      Height = 23
+      Height = 22
       Hint = 'Max balance'
       Top = 33
       Width = 83
@@ -140,17 +140,17 @@ object FRMAccountExplorer: TFRMAccountExplorer
   end
   object pnlAccounts: TPanel
     Left = 0
-    Height = 385
+    Height = 366
     Top = 66
     Width = 380
     Align = alLeft
     BevelOuter = bvNone
-    ClientHeight = 385
+    ClientHeight = 366
     ClientWidth = 380
     TabOrder = 1
     object dgAccounts: TDrawGrid
       Left = 0
-      Height = 351
+      Height = 332
       Top = 0
       Width = 380
       Align = alClient
@@ -164,7 +164,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
     object pnlAccountsInfo: TPanel
       Left = 0
       Height = 34
-      Top = 351
+      Top = 332
       Width = 380
       Align = alBottom
       BevelOuter = bvNone
@@ -173,33 +173,33 @@ object FRMAccountExplorer: TFRMAccountExplorer
       TabOrder = 1
       object Label17: TLabel
         Left = 5
-        Height = 15
+        Height = 14
         Top = 10
-        Width = 53
+        Width = 55
         Caption = 'Accounts:'
         ParentColor = False
       end
       object Label19: TLabel
         Left = 136
-        Height = 15
+        Height = 14
         Top = 10
-        Width = 44
+        Width = 45
         Caption = 'Balance:'
         ParentColor = False
       end
       object lblAccountsCount: TLabel
         Left = 60
-        Height = 15
+        Height = 14
         Top = 10
-        Width = 18
+        Width = 21
         Caption = '000'
         ParentColor = False
       end
       object lblAccountsBalance: TLabel
         Left = 200
-        Height = 15
+        Height = 14
         Top = 10
-        Width = 18
+        Width = 21
         Caption = '000'
         ParentColor = False
       end
@@ -245,7 +245,7 @@ object FRMAccountExplorer: TFRMAccountExplorer
   end
   object pcAccountsOptions: TPageControl
     Left = 385
-    Height = 385
+    Height = 366
     Top = 66
     Width = 483
     ActivePage = tsAccountOperations
@@ -254,11 +254,11 @@ object FRMAccountExplorer: TFRMAccountExplorer
     TabOrder = 2
     object tsAccountOperations: TTabSheet
       Caption = 'Operations of selected Account'
-      ClientHeight = 357
+      ClientHeight = 339
       ClientWidth = 475
       object dgAccountOperations: TDrawGrid
         Left = 0
-        Height = 357
+        Height = 339
         Top = 0
         Width = 475
         Align = alClient
@@ -471,8 +471,8 @@ object FRMAccountExplorer: TFRMAccountExplorer
     end
   end
   object meAccountExplorerMenu: TMainMenu
-    left = 240
-    top = 16
+    Left = 240
+    Top = 16
     object miTools: TMenuItem
       Caption = 'Tools'
       object miNewOperation: TMenuItem

+ 1 - 1
src/gui-experimental/UFRMAccountExplorer.pas

@@ -25,7 +25,7 @@ interface
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
   ExtCtrls, StdCtrls, Buttons, Grids, Menus,
-  UCommon.UI, UBaseTypes, UGridUtils, UNode, UAccounts, UBlockChain;
+  UCommon.UI, UBaseTypes, UPCDataTypes, UGridUtils, UNode, UAccounts, UBlockChain;
 
 type
 

+ 4 - 4
src/gui-experimental/UFRMAccountSelect.pas

@@ -26,7 +26,7 @@ uses
   LCLIntf, LCLType, LMessages,
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, UAccounts, Grids, StdCtrls, Buttons, ExtCtrls, UCommon.UI,
-  UWallet, UNode, UGridUtils, UFRMMemoText, UConst, UThread, UPCOrderedLists, UBaseTypes;
+  UWallet, UNode, UGridUtils, UFRMMemoText, UConst, UThread, UPCOrderedLists, UBaseTypes, UPCDataTypes;
 
 const
   CT_AS_MyAccounts = $0001;
@@ -156,7 +156,7 @@ procedure TSearchThread.BCExecute;
     SetLength(FAccounts,0);
     c := 0;
     maxC := FSearchValues.SafeBox.AccountsCount-1;
-    validAccKey := TAccountComp.IsValidAccountKey(FSearchValues.inAccountKey,errors);
+    validAccKey := TAccountComp.IsValidAccountKey(FSearchValues.inAccountKey, FSearchValues.SafeBox.CurrentProtocol, errors);
     while (c<=maxC) And (Not Terminated) And (Not FDoStopSearch) do begin
       account := FSearchValues.SafeBox.Account(c);
       isValid := True;
@@ -169,10 +169,10 @@ procedure TSearchThread.BCExecute;
         isValid := TAccountComp.IsAccountForSale(account.accountInfo);
       end;
       If IsValid and (FSearchValues.onlyForPublicSale) then begin
-        isValid := (TAccountComp.IsAccountForSale(account.accountInfo)) And (Not TAccountComp.IsAccountForSaleAcceptingTransactions(account.accountInfo));
+        isValid := (TAccountComp.IsAccountForSale(account.accountInfo)) And (Not TAccountComp.IsAccountForSaleOrSwapAcceptingTransactions(account, FSearchValues.SafeBox.BlocksCount, FSearchValues.SafeBox.CurrentProtocol, nil));  // Skybuck: todo check/debug !
       end;
       If IsValid and (FSearchValues.onlyForPrivateSaleToMe) then begin
-        isValid := (TAccountComp.IsAccountForSaleAcceptingTransactions(account.accountInfo)) And
+        isValid := ( TAccountComp.IsAccountForSaleOrSwapAcceptingTransactions(account,FSearchValues.SafeBox.BlocksCount, FSearchValues.SafeBox.CurrentProtocol, nil)) And // Skybuck: todo check/debug !
           (Assigned(FSearchValues.inWalletKeys)) And (FSearchValues.inWalletKeys.IndexOfAccountKey(account.accountInfo.new_publicKey)>=0);
       end;
       If IsValid then begin

+ 23 - 13
src/gui-experimental/UFRMOperation.pas

@@ -27,7 +27,7 @@ uses
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls, UCommon.UI,
   UNode, UWallet, UCrypto, Buttons, UBlockChain, UBaseTypes,
-  UAccounts, UFRMAccountSelect, ActnList, ComCtrls, Types, UCommon, UPCOrderedLists;
+  UAccounts, UFRMAccountSelect, ActnList, ComCtrls, Types, UCommon, UPCOrderedLists, UPCDataTypes;
 
 Const
   CM_PC_WalletKeysChanged = WM_USER + 1;
@@ -143,7 +143,8 @@ type
     FNode : TNode;
     FWalletKeys: TWalletKeys;
     FDefaultFee: Int64;
-    FEncodedPayload : TRawBytes;
+//    FEncodedPayload : TRawBytes;
+    FOperationPayload : TOperationPayload;
     FDisabled : Boolean;
     FSenderAccounts: TOrderedCardinalList; // TODO: TOrderedCardinalList should be replaced with a "TCardinalList" since signer account should be processed last
     procedure SetWalletKeys(const Value: TWalletKeys);
@@ -178,7 +179,7 @@ implementation
 
 uses
   UPCEncryption,
-  UCoreUtils, UConst, UOpTransaction, UFRMWalletKeys, UUserInterface, UPCDataTypes;
+  UCoreUtils, UConst, UOpTransaction, UFRMWalletKeys, UUserInterface;
 
 {$R *.lfm}
 
@@ -201,6 +202,11 @@ Var errors : AnsiString;
   _newType : Word;
   _changeName, _changeType, _V2, _executeSigner  : Boolean;
   _senderAccounts : TCardinalsArray;
+  LNewAccountState : TAccountState;
+  LAccountTarget : cardinal;
+  LHashLock : T32Bytes;
+  lChangeData : boolean;
+  LNewData : TRawBytes;
 label loop_start;
 begin
   if Not Assigned(WalletKeys) then raise Exception.Create('No wallet keys');
@@ -252,7 +258,7 @@ loop_start:
         end;
         if dooperation then begin
           op := TOpTransaction.CreateTransaction(FNode.Bank.SafeBox.CurrentProtocol,
-          account.account,account.n_operation+1,destAccount.account,wk.PrivateKey,_amount,_fee,FEncodedPayload);
+          account.account,account.n_operation+1,destAccount.account,wk.PrivateKey,_amount,_fee,FOperationPayload);
           inc(_totalamount,_amount);
           inc(_totalfee,_fee);
         end;
@@ -272,11 +278,11 @@ loop_start:
           if uint64(_totalSignerFee) >= signerAccount.balance then _fee := 0
           else if signerAccount.balance - uint64(_totalSignerFee) > uint64(DefaultFee) then _fee := DefaultFee
           else _fee := signerAccount.balance - uint64(_totalSignerFee);
-          op := TOpChangeKeySigned.Create(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+_signer_n_ops+1,account.account,wk.PrivateKey,_newOwnerPublicKey,_fee,FEncodedPayload);
+          op := TOpChangeKeySigned.Create(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+_signer_n_ops+1,account.account,wk.PrivateKey,_newOwnerPublicKey,_fee,FOperationPayload);
           inc(_signer_n_ops);
           inc(_totalSignerFee, _fee);
         end else begin
-          op := TOpChangeKey.Create(FNode.Bank.SafeBox.CurrentProtocol,account.account,account.n_operation+1,account.account,wk.PrivateKey,_newOwnerPublicKey,_fee,FEncodedPayload);
+          op := TOpChangeKey.Create(FNode.Bank.SafeBox.CurrentProtocol,account.account,account.n_operation+1,account.account,wk.PrivateKey,_newOwnerPublicKey,_fee,FOperationPayload);
         end;
         inc(_totalfee,_fee);
         operationstxt := 'Change private key to '+TAccountComp.GetECInfoTxt(_newOwnerPublicKey.EC_OpenSSL_NID);
@@ -288,9 +294,11 @@ loop_start:
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         else _fee := signerAccount.balance;
         if (rbListAccountForPublicSale.Checked) then begin
-          op := TOpListAccountForSale.CreateListAccountForSale(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+1+iAcc, account.account,_salePrice,_fee,destAccount.account,CT_TECDSA_Public_Nul,0,wk.PrivateKey,FEncodedPayload);
+          LHashLock := CT_HashLock_NUL; // Skybuck: check or debug ! LHashLock zero value array passed in function below perhaps replace with correctly filled hash array !
+          // Skybuck: LNewAccountState parameter added, check or debug this later ! passed in function below ! LNewAccountState is not set yet !
+          op := TOpListAccountForSaleOrSwap.CreateListAccountForSaleOrSwap(FNode.Bank.SafeBox.CurrentProtocol, LNewAccountState, signerAccount.account,signerAccount.n_operation+1+iAcc, account.account,_salePrice,_fee, destAccount.account,CT_TECDSA_Public_Nul,0,wk.PrivateKey,LHashLock, FOperationPayload);
         end else if (rbListAccountForPrivateSale.Checked) then begin
-          op := TOpListAccountForSale.CreateListAccountForSale(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+1+iAcc, account.account,_salePrice,_fee,destAccount.account,_newOwnerPublicKey,_lockedUntil,wk.PrivateKey,FEncodedPayload);
+          op := TOpListAccountForSaleOrSwap.CreateListAccountForSaleOrSwap(FNode.Bank.SafeBox.CurrentProtocol, LNewAccountState, signerAccount.account,signerAccount.n_operation+1+iAcc, account.account,_salePrice,_fee, destAccount.account,_newOwnerPublicKey,_lockedUntil,wk.PrivateKey,LHashLock, FOperationPayload);
         end else raise Exception.Create('Select Sale type');
         {%endregion}
       end else if (PageControlOpType.ActivePage = tsDelist) then begin
@@ -299,21 +307,22 @@ loop_start:
         // Special fee account:
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         else _fee := signerAccount.balance;
-        op := TOpDelistAccountForSale.CreateDelistAccountForSale(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+1+iAcc,account.account,_fee,wk.PrivateKey,FEncodedPayload);
+        op := TOpDelistAccountForSale.CreateDelistAccountForSale(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+1+iAcc,account.account,_fee,wk.PrivateKey,FOperationPayload);
         {%endregion}
       end else if (PageControlOpType.ActivePage = tsBuyAccount) then begin
         {%region Operation: Buy Account}
         if Not UpdateOpBuyAccount(account,accountToBuy,_amount,_newOwnerPublicKey,errors) then raise Exception.Create(errors);
         op := TOpBuyAccount.CreateBuy(FNode.Bank.SafeBox.CurrentProtocol,account.account,account.n_operation+1,accountToBuy.account,accountToBuy.accountInfo.account_to_pay,
-          accountToBuy.accountInfo.price,_amount,_fee,_newOwnerPublicKey,wk.PrivateKey,FEncodedPayload);
+          accountToBuy.accountInfo.price,_amount,_fee,_newOwnerPublicKey,wk.PrivateKey,FOperationPayload);
         {%endregion}
       end else if (PageControlOpType.ActivePage = tsChangeInfo) then begin
         {%region Operation: Change Info}
         if not UpdateOpChangeInfo(account,signerAccount,_changeName,_newName,_changeType,_newType,errors) then raise Exception.Create(errors);
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         else _fee := signerAccount.balance;
+        // Skybuck: check or debug LChangeData and LNewData !! (newly added, no correct values yet set in these two variables !?!)
         op := TOpChangeAccountInfo.CreateChangeAccountInfo(FNode.Bank.SafeBox.CurrentProtocol,signerAccount.account,signerAccount.n_operation+1,account.account,wk.PrivateKey,false,CT_TECDSA_Public_Nul,
-           _changeName,_newName,_changeType,_newType,_fee,FEncodedPayload);
+           _changeName,_newName,_changeType,_newType,LChangeData,LNewData,_fee,FOperationPayload);
         {%endregion}
       end else begin
         raise Exception.Create('No operation selected');
@@ -1246,7 +1255,7 @@ Var payload_u : AnsiString;
 begin
   valid := false;
   payload_encrypted := Nil;
-  FEncodedPayload := Nil;
+  FOperationPayload.payload_raw := nil;
   errors := 'Unknown error';
   payload_u := memoPayload.Lines.Text;
   try
@@ -1349,7 +1358,8 @@ begin
       lblEncryptionErrors.Caption := errors;
       lblPayloadLength.Caption := Format('(%db -> ?)',[length(payload_u)]);
     end;
-    FEncodedPayload := payload_encrypted;
+    FOperationPayload.payload_raw := payload_encrypted;
+
     Result := valid;
   end;
 end;

+ 8 - 2
src/gui-experimental/UFRMPascalCoinWalletConfig.pas

@@ -84,7 +84,7 @@ type
 
 implementation
 
-uses UConst, USettings, UAccounts, ULog, UCrypto, UFolderHelper, UWallet, UUserInterface, UCommon;
+uses UConst, USettings, UAccounts, ULog, UCrypto, UFolderHelper, UWallet, UUserInterface, UCommon, UNode;
 
 {$R *.lfm}
 
@@ -135,7 +135,13 @@ end;
 
 procedure TFRMPascalCoinWalletConfig.bbOpenDataFolderClick(Sender: TObject);
 begin
-  OpenDocument(PChar(TFolderHelper.GetPascalCoinDataFolder))
+  // Skybuck:TFolderHelper.GetPascalCoinDataFolder don't exist no more replaced with TNode.GetPascalCoinDataFolder
+  // OpenDocument(PChar(TFolderHelper.GetPascalCoinDataFolder))
+  // Two solutions possible:
+  // 1: TNode.GetPascalCoinDataFolder
+  // 2. TFolderHelper.GetDataFolder(CT_PascalCoin_Data_Folder
+  // I will try TNode first if this does not work use solution 2.
+  OpenDocument(PChar(TNode.GetPascalCoinDataFolder));
 end;
 
 procedure TFRMPascalCoinWalletConfig.bbUpdatePasswordClick(Sender: TObject);

+ 2 - 2
src/gui-experimental/UFRMPayloadDecoder.pas

@@ -330,7 +330,7 @@ begin
     else if Value.Fee=0 then lblFee.Font.Color := clGray
     else lblFee.Font.Color := clRed;
     ebOpHash.text := TCrypto.ToHexaString(Value.OperationHash);
-    memoOriginalPayloadInHexa.Lines.Text := TCrypto.ToHexaString(Value.OriginalPayload);
+    memoOriginalPayloadInHexa.Lines.Text := TCrypto.ToHexaString(Value.OriginalPayload.payload_raw);
     cbMethodPublicPayload.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.notencrypted'].GetAsBoolean(true);
     cbUsingPrivateKeys.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.usingprivatekeys'].GetAsBoolean(true);
     cbUsingPasswords.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.usingpasswords'].GetAsBoolean(true);
@@ -387,7 +387,7 @@ Var raw : TRawBytes;
 begin
   ok := true;
   if Assigned(TWallet.Keys) then begin
-    raw := FOpResume.OriginalPayload;
+    raw := FOpResume.OriginalPayload.payload_raw;
     if Length(raw)>0 then begin
       // First try to a human readable...
       if (cbMethodPublicPayload.Checked) and (TCrypto.IsHumanReadable(raw)) then begin

+ 6 - 6
src/gui-experimental/UUserInterface.pas

@@ -27,7 +27,7 @@ uses
   Dialogs, LCLType,
   UCommon, UCommon.UI,
   UBlockChain, UAccounts, UNode, UWallet, UConst, UFolderHelper, UGridUtils, URPC, UPoolMining,
-  ULog, UThread, UNetProtocol, UCrypto, UBaseTypes,
+  ULog, UThread, UNetProtocol, UCrypto, UBaseTypes, UPCDataTypes,
   UFRMMainForm, UCTRLSyncronization, UFRMAccountExplorer, UFRMOperationExplorer, UFRMPendingOperations, UFRMOperation,
   UFRMLogs, UFRMMessages, UFRMNodes, UFRMBlockExplorer, UFRMWalletKeys, UPCOrderedLists {$IFDEF TESTNET},UFRMRandomOperations, UAccountKeyStorage{$ENDIF};
 
@@ -342,8 +342,8 @@ begin
     FLog.SaveTypes := [];
 
     // Create data directories
-    If Not ForceDirectories(TFolderHelper.GetPascalCoinDataFolder) then
-      raise Exception.Create('Cannot create dir: '+TFolderHelper.GetPascalCoinDataFolder);
+    If Not ForceDirectories(TNode.GetPascalCoinDataFolder) then
+      raise Exception.Create('Cannot create dir: '+TNode.GetPascalCoinDataFolder);
 
     // Load settings
     TSettings.Load;
@@ -378,7 +378,7 @@ begin
 
     // Initialise Database
     FNode.Bank.StorageClass := TFileStorage;
-    TFileStorage(FNode.Bank.Storage).DatabaseFolder := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'Data';
+    TFileStorage(FNode.Bank.Storage).DatabaseFolder := TNode.GetPascalCoinDataFolder+PathDelim+'Data';
     TFileStorage(FNode.Bank.Storage).Initialize;
 
     // Reading database
@@ -616,7 +616,7 @@ begin
       FLog.SaveTypes := CT_TLogTypes_ALL
     else
       FLog.SaveTypes := CT_TLogTypes_DEFAULT;
-    FLog.FileName := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'PascalCointWallet.log';
+    FLog.FileName := TNode.GetPascalCoinDataFolder+PathDelim+'PascalCointWallet.log';
   end else begin
     FLog.SaveTypes := [];
     FLog.FileName := '';
@@ -631,7 +631,7 @@ begin
     finally
       FNode.UnlockMempoolWrite;
     end;
-    FNode.NodeLogFilename := TFolderHelper.GetPascalCoinDataFolder+PathDelim+'blocks.log';
+    FNode.NodeLogFilename := TNode.GetPascalCoinDataFolder+PathDelim+'blocks.log';
   end;
   if Assigned(FPoolMiningServer) then begin
     if FPoolMiningServer.Port <> TSettings.MinerServerRpcPort then begin

+ 59 - 39
src/gui-experimental/core.utils/UCoreUtils.pas

@@ -23,14 +23,14 @@ interface
 
 uses
   Classes, SysUtils, Forms, Dialogs, LCLType, UAccounts, UBlockChain, UNode, UWallet,
-  UBaseTypes, UCommon, UCoreObjects, UCommon.Collections, Generics.Defaults;
+  UBaseTypes, UCommon, UCoreObjects, UCommon.Collections, Generics.Defaults, UPCDataTypes;
 
 type
 
   { TAccountComparer }
 
   TAccountComparer = class(TComparer<TAccount>)
-    function Compare(constref ALeft, ARight: T): integer; override;
+    function Compare(constref ALeft, ARight: TAccount): integer; override;
     class function DoCompare(constref ALeft, ARight: TAccount): integer; inline;
   end;
 
@@ -47,7 +47,7 @@ type
   { TAccountKeyComparer }
 
   TAccountKeyComparer = class(TComparer<TAccountKey>)
-    function Compare(constref ALeft, ARight: T): integer; override;
+    function Compare(constref ALeft, ARight: TAccountKey): integer; override;
     class function DoCompare(constref ALeft, ARight: TAccountKey): integer; inline;
   end;
 
@@ -114,7 +114,8 @@ type
   private
     class function IsOwnerOfWallet(AAccount: TAccount; AWalletKeys: TWalletKeys; out AWalletKey: TWalletKey; var AErrorMessage: string): boolean; static;
     class function ValidateOperationsInput(const ASelectedAccounts: TArray<TAccount>; AWalletKeys: TWalletKeys; ANode: TNode; var AErrorMessage: string): boolean; static;
-    class function UpdatePayload(const ASenderPublicKey, ADestinationPublicKey: TAccountKey; const APayloadEncryptionMode: TPayloadEncryptionMode; const APayloadContent: string; var AEncodedPayloadBytes: TRawBytes; const APayloadEncryptionPassword: string; var AErrorMessage: string): boolean; static;
+    class function UpdatePayload(const ASenderPublicKey, ADestinationPublicKey: TAccountKey; const APayloadEncryptionMode: TPayloadEncryptionMode; const APayloadContent: string; var AEncodedPayloadBytes: TRawBytes; const APayloadEncryptionPassword: string; var AErrorMessage: string): boolean; static; overload;
+    class function UpdatePayload(const ASenderPublicKey, ADestinationPublicKey: TAccountKey; const APayloadEncryptionMode: TPayloadEncryptionMode; const APayloadContent: string; var AOperationPayload: TOperationPayload; const APayloadEncryptionPassword: string; var AErrorMessage: string): boolean; static; overload;
     class function SendPASCFinalizeAndDisplayMessage(const AOperationsTxt, AOperationToString: string; ANoOfOperations: integer; ATotalAmount, ATotalFee: int64; AOperationsHashTree: TOperationsHashTree; var AErrorMessage: string): boolean; static;
     class function OthersFinalizeAndDisplayMessage(const AOperationsTxt, AOperationToString: string; ANoOfOperations: integer; ATotalFee: int64; AOperationsHashTree: TOperationsHashTree; var AErrorMessage: string): boolean; static;
   public
@@ -232,7 +233,7 @@ var
   i, j: integer;
   LAccs: TList<TAccount>;
   LAcc: TAccount;
-  LList: TOrderedCardinalList;
+  LList: TAccountsNumbersList;
   LMemPool: TPCOperationsComp;
   Disposables: TDisposables;
 begin
@@ -268,7 +269,7 @@ class function TCoreTool.GetUserAccountNumbers: TArray<cardinal>;
 var
   i, j: integer;
   LAccs: TSortedList<cardinal>;
-  LList: TOrderedCardinalList;
+  LList: TAccountsNumbersList;
   Disposables: TDisposables;
 begin
   LAccs := Disposables.AddObject(TSortedList<cardinal>.Create) as TSortedList<cardinal>;
@@ -478,7 +479,7 @@ var
 
   function GetAccountLastUpdateBlock(constref AAccount: TAccount): cardinal;
   begin
-    Result := AAccount.updated_block;
+    Result := AAccount.GetLastUpdatedBlock;
   end;
 
 begin
@@ -496,8 +497,8 @@ begin
     // if account is modified in block-tip
     LAcc := LAccounts[i];
     LAccountBalances.AddOrSetValue(LAcc.account, LAcc.Balance);  // track account balances
-    LBlockTraversal.Add(LAcc.updated_block);
-    MarkAccountAsScannableAtBlock(LAcc.account, LAcc.updated_block);
+    LBlockTraversal.Add(LAcc.GetLastUpdatedBlock);
+    MarkAccountAsScannableAtBlock(LAcc.account, LAcc.GetLastUpdatedBlock);
   end;
 
   // Traverse the set of "last updated" blocks in DESCENDING order
@@ -544,7 +545,7 @@ begin
   Result :=
     (ALeft.account = ARight.account) and
     (ALeft.balance = ARight.balance) and
-    (ALeft.updated_block = ARight.updated_block) and
+    (ALeft.GetLastUpdatedBlock = ARight.GetLastUpdatedBlock) and
     (ALeft.n_operation = ARight.n_operation) and
     TAccountKeyEqualityComparer.AreEqual(ALeft.accountInfo.accountKey, ARight.accountInfo.accountKey);
 end;
@@ -556,7 +557,7 @@ end;
 
 { TAccountKeyComparer }
 
-function TAccountKeyComparer.Compare(constref ALeft, ARight: T): integer;
+function TAccountKeyComparer.Compare(constref ALeft, ARight: TAccountKey): integer;
 begin
   Result := TAccountKeyComparer.DoCompare(ALeft, ARight);
 end;
@@ -614,7 +615,8 @@ begin
   builder.Append('');
   builder.Append(Format('Current balance: %s', [TAccountComp.FormatMoney(Self.balance)]));
   builder.Append('');
-  builder.Append(Format('Updated on block: %d  (%d blocks ago)', [Self.updated_block, ABank.BlocksCount - Self.updated_block]));
+  builder.Append(Format('Passively updated on block: %d  (%d blocks ago)', [Self.updated_on_block_passive_mode, ABank.BlocksCount - Self.updated_on_block_passive_mode]));
+  builder.Append(Format('Actively updated on block: %d  (%d blocks ago)', [Self.updated_on_block_active_mode, ABank.BlocksCount - Self.updated_on_block_active_mode]));
   builder.Append(Format('Public key type: %s', [TAccountComp.GetECInfoTxt(Self.accountInfo.accountKey.EC_OpenSSL_NID)]));
   builder.Append(Format('Base58 Public key: %s', [TAccountComp.AccountPublicKeyExport(Self.accountInfo.accountKey)]));
   if TAccountComp.IsAccountForSale(Self.accountInfo) then
@@ -623,7 +625,9 @@ begin
     builder.Append('** Account is for sale: **');
     builder.Append(Format('Price: %s', [TAccountComp.FormatMoney(Self.accountInfo.price)]));
     builder.Append(Format('Seller account (where to pay): %s', [TAccountComp.AccountNumberToAccountTxtNumber(Self.accountInfo.account_to_pay)]));
-    if TAccountComp.IsAccountForSaleAcceptingTransactions(Self.accountInfo) then
+//    if TAccountComp.IsAccountForSaleAcceptingTransactions(Self.accountInfo) then // Skybuck *old*
+    // Skybuck: funtionality partially restored, unsure of last parameter, unsure of parameter 2 and 3, needs testing and debugging
+    if TAccountComp.IsAccountForSaleOrSwapAcceptingTransactions(Self, ABank.SafeBox.BlocksCount, ABank.SafeBox.CurrentProtocol, nil ) then // Skybuck *new*
     begin
       builder.Append('');
       builder.Append('** Private sale **');
@@ -669,12 +673,12 @@ begin
   builder.Add(Format('Operation Hash (ophash): %s', [TCrypto.ToHexaString(Self.OperationHash)]));
   if (Self.OperationHash_OLD <> nil) then
     builder.Add(Format('Old Operation Hash (old_ophash): %s', [TCrypto.ToHexaString(Self.OperationHash_OLD)]));
-  if (Self.OriginalPayload <> nil) then
+  if (Self.OriginalPayload.payload_raw <> nil) then
   begin
-    builder.Add(Format('Payload length:%d', [length(Self.OriginalPayload)]));
+    builder.Add(Format('Payload length:%d', [length(Self.OriginalPayload.payload_raw)]));
     if Self.PrintablePayload <> '' then
       builder.Add(Format('Payload (human): %s', [Self.PrintablePayload]));
-    builder.Add(Format('Payload (Hexadecimal): %s', [TCrypto.ToHexaString(Self.OriginalPayload)]));
+    builder.Add(Format('Payload (Hexadecimal): %s', [TCrypto.ToHexaString(Self.OriginalPayload.payload_raw)]));
   end;
   if Self.Balance >= 0 then
     builder.Add(Format('Final balance: %s', [TAccountComp.FormatMoney(Self.Balance)]));
@@ -857,6 +861,11 @@ begin
   end;
 end;
 
+class function TWIZOperationsHelper.UpdatePayload(const ASenderPublicKey, ADestinationPublicKey: TAccountKey; const APayloadEncryptionMode: TPayloadEncryptionMode; const APayloadContent: string; var AOperationPayload: TOperationPayload; const APayloadEncryptionPassword: string; var AErrorMessage: string): boolean;
+begin
+  result := UpdatePayload( ASenderPublicKey, ADestinationPublicKey, APayloadEncryptionMode, APayloadContent, AOperationPayload.payload_raw, APayloadEncryptionPassword, AErrorMessage );
+end;
+
 class function TWIZOperationsHelper.OthersFinalizeAndDisplayMessage(const AOperationsTxt, AOperationToString: string; ANoOfOperations: integer; ATotalFee: int64; AOperationsHashTree: TOperationsHashTree; var AErrorMessage: string): boolean;
 var
   LAuxs, LOperationsTxt: string;
@@ -921,7 +930,7 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 
   LWalletKeys := TWallet.Keys;
@@ -951,7 +960,7 @@ begin
         Exit(False);
       end;
 
-      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, ADestinationAccount.accountInfo.accountKey, APayloadEncryptionMode, APayloadContent, LPayloadEncodedBytes, APayloadEncryptionPassword, AErrorMessage) then
+      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, ADestinationAccount.accountInfo.accountKey, APayloadEncryptionMode, APayloadContent, LOperationPayload, APayloadEncryptionPassword, AErrorMessage) then
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
@@ -987,7 +996,7 @@ begin
       if LDoOperation then
       begin
         LPCOperation := TOpTransaction.CreateTransaction(
-          TNode.Node.Bank.Safebox.CurrentProtocol, LCurrentAccount.account, LCurrentAccount.n_operation + 1, ADestinationAccount.account, LWalletKey.PrivateKey, LAmount, LFee, LPayloadEncodedBytes);
+          TNode.Node.Bank.Safebox.CurrentProtocol, LCurrentAccount.account, LCurrentAccount.n_operation + 1, ADestinationAccount.account, LWalletKey.PrivateKey, LAmount, LFee, LOperationPayload);
         try
           LTemp := Format('%d. Transfer of %s PASC from %s to %s %s', [LNoOfOperations + 1, TAccountComp.FormatMoney(LAmount), LCurrentAccount.AccountString, ADestinationAccount.AccountString, sLineBreak]);
           if LOperationsTxt <> '' then
@@ -1036,7 +1045,7 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount, LSignerAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
 label
   loop_start;
 begin
@@ -1091,7 +1100,7 @@ begin
       else
         LSignerAccount := LCurrentAccount;
 
-      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, APublicKey, APayloadEncryptionMode, APayloadContent, LPayloadEncodedBytes, APayloadEncryptionPassword, AErrorMessage) then
+      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, APublicKey, APayloadEncryptionMode, APayloadContent, LOperationPayload, APayloadEncryptionPassword, AErrorMessage) then
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
@@ -1119,11 +1128,11 @@ begin
 
         LPCOperation := TOpChangeKeySigned.Create(LNode.Bank.Safebox.CurrentProtocol, LSignerAccount.account,
           LSignerAccount.n_operation + LNoOfOperations + 1, LCurrentAccount.account,
-          LWalletKey.PrivateKey, APublicKey, LFee, LPayloadEncodedBytes);
+          LWalletKey.PrivateKey, APublicKey, LFee, LOperationPayload );
       end
       else
         LPCOperation := TOpChangeKey.Create(LNode.Bank.Safebox.CurrentProtocol, LCurrentAccount.account, LCurrentAccount.n_operation +
-          1, LCurrentAccount.account, LWalletKey.PrivateKey, APublicKey, LFee, LPayloadEncodedBytes);
+          1, LCurrentAccount.account, LWalletKey.PrivateKey, APublicKey, LFee, LOperationPayload);
 
       try
         LTemp := Format('%d. Change Key To %s', [LNoOfOperations + 1, TAccountComp.GetECInfoTxt(APublicKey.EC_OpenSSL_NID), sLineBreak]);
@@ -1171,7 +1180,9 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount, LSignerAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
+  LANewAccountState : TAccountState;
+  LHashLock : T32Bytes;
 begin
 
   LWalletKeys := TWallet.Keys;
@@ -1236,26 +1247,31 @@ begin
       else
         LFee := LSignerAccount.balance;
 
-      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, LSignerAccount.accountInfo.accountKey, APayloadEncryptionMode, APayloadContent, LPayloadEncodedBytes, APayloadEncryptionPassword, AErrorMessage) then
+      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, LSignerAccount.accountInfo.accountKey, APayloadEncryptionMode, APayloadContent, LOperationPayload, APayloadEncryptionPassword, AErrorMessage) then
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
       end;
 
+      LHashLock := CT_HashLock_NUL; // Skybuck: check or debug if this needs to be a parameter, calculated or if it can be a nil record. Passed below into function
+
       case AAccountSaleMode of
         akaPublicSale:
-
-          LPCOperation := TOpListAccountForSale.CreateListAccountForSale(
-            LNode.Bank.Safebox.CurrentProtocol, LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx,
+          LPCOperation := TOpListAccountForSaleOrSwap.CreateListAccountForSaleOrSwap(
+            LNode.Bank.Safebox.CurrentProtocol,
+            LANewAccountState, // Skybuck: check or debug LANewAccountState, perhaps this needs to be a parameter in the above function header ?!?
+            LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx,
             LCurrentAccount.account, ASalePrice, LFee, ASellerAccount.account,
-            APublicKey, 0, LWalletKey.PrivateKey, LPayloadEncodedBytes);
+            APublicKey, 0, LWalletKey.PrivateKey, LHashLock, LOperationPayload); // Skybuck: check or debug LHashLock ! Perhaps needs to be a parameter to above function header ?!?
 
         akaPrivateSale:
 
-          LPCOperation := TOpListAccountForSale.CreateListAccountForSale(
-            LNode.Bank.Safebox.CurrentProtocol, LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx,
+          LPCOperation := TOpListAccountForSaleOrSwap.CreateListAccountForSaleOrSwap(
+            LNode.Bank.Safebox.CurrentProtocol,
+            LANewAccountState, // Skybuck not sure if this must be a parameter or acquired locally or left empty, for now adding to code.
+            LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx,
             LCurrentAccount.account, ASalePrice, LFee, ASellerAccount.account,
-            APublicKey, ALockedUntilBlock, LWalletKey.PrivateKey, LPayloadEncodedBytes)
+            APublicKey, ALockedUntilBlock, LWalletKey.PrivateKey, CT_HashLock_NUL, LOperationPayload); // Skybuck: somebody check if hashlock can be a nil record
         else
           raise Exception.Create('Invalid Account Sale Type')
       end;
@@ -1306,7 +1322,7 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount, LSignerAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 
   LWalletKeys := TWallet.Keys;
@@ -1366,7 +1382,7 @@ begin
       else
         LFee := LSignerAccount.balance;
 
-      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, LSignerAccount.accountInfo.accountKey, APayloadEncryptionMode, APayloadContent, LPayloadEncodedBytes, APayloadEncryptionPassword, AErrorMessage) then
+      if not UpdatePayload(LCurrentAccount.accountInfo.accountKey, LSignerAccount.accountInfo.accountKey, APayloadEncryptionMode, APayloadContent, LOperationPayload, APayloadEncryptionPassword, AErrorMessage) then
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
@@ -1374,7 +1390,7 @@ begin
 
       LPCOperation := TOpDelistAccountForSale.CreateDelistAccountForSale(LNode.Bank.Safebox.CurrentProtocol,
         LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx, LCurrentAccount.account, LFee, LWalletKey.PrivateKey,
-        LPayloadEncodedBytes);
+        LOperationPayload);
 
       try
         LTemp := Format('%d. Delist Account %s From Sale %s', [LNoOfOperations + 1, LCurrentAccount.DisplayString, sLineBreak]);
@@ -1424,6 +1440,9 @@ var
   LCurrentAccount, LSignerAccount: TAccount;
   LPayloadEncodedBytes, LNewName: TRawBytes;
   LChangeType, LChangeName: boolean;
+  LChangeData : boolean;
+  LNewData : TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 
   LWalletKeys := TWallet.Keys;
@@ -1523,10 +1542,9 @@ begin
         Exit(False);
       end;
 
-
-      LPCOperation := TOpChangeAccountInfo.CreateChangeAccountInfo(LNode.Bank.Safebox.CurrentProtocol,
+      LPCOperation := TOpChangeAccountInfo.CreateChangeAccountInfo( LNode.Bank.Safebox.CurrentProtocol,
         LSignerAccount.account, LSignerAccount.n_operation + 1, LCurrentAccount.account, LWalletKey.PrivateKey, False, CT_TECDSA_Public_Nul,
-        LChangeName, LNewName, LChangeType, ANewType, LFee, LPayloadEncodedBytes);
+        LChangeName, LNewName, LChangeType, ANewType, LChangeData, LNewData, LFee, LOperationPayload);
 
       try
         if (LChangeName) and (LChangeType) then
@@ -1587,6 +1605,7 @@ var
   LAccountIdx, LNoOfOperations, LAccNumberIndex: integer;
   LCurrentAccount, LSignerAccount: TAccount;
   LPayloadEncodedBytes, LNewName: TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 
   LWalletKeys := TWallet.Keys;
@@ -1644,8 +1663,9 @@ begin
         Exit(False);
       end;
 
+      LOperationPayload.payload_raw := LPayloadEncodedBytes;
       LPCOperation := TOpBuyAccount.CreateBuy(LNode.Bank.Safebox.CurrentProtocol, LCurrentAccount.account, LCurrentAccount.n_operation + 1, AAccountToBuy.account, AAccountToBuy.accountInfo.account_to_pay,
-        AAccountToBuy.accountInfo.price, AAmount, LFee, ANewOwnerPublicKey, LWalletKey.PrivateKey, LPayloadEncodedBytes);
+        AAccountToBuy.accountInfo.price, AAmount, LFee, ANewOwnerPublicKey, LWalletKey.PrivateKey, LOperationPayload);
 
       try
       LTemp := Format('%d. Buy Account %s for %s PASC %s', [LNoOfOperations + 1, AAccountToBuy.AccountString, TAccountComp.FormatMoney(AAmount), sLineBreak]);

+ 4 - 4
src/gui-experimental/core.utils/UDataSources.pas

@@ -21,7 +21,7 @@ interface
 uses
   Classes, SysUtils, UAccounts, UNode, UBlockchain, UCrypto, UCoreObjects,
   UCommon, UMemory, UConst, UCommon.Data, UCoreUtils, UBaseTypes,
-  UCommon.Collections, Generics.Collections, Generics.Defaults, syncobjs;
+  UCommon.Collections, Generics.Collections, Generics.Defaults, syncobjs, UPCDataTypes;
 
 type
 
@@ -189,7 +189,7 @@ begin
   else if ABindingName = 'NOperation' then
     Result := AItem.n_operation
   else if ABindingName = 'LastUpdatedBlock' then
-    Result := AItem.updated_block
+    Result := AItem.GetLastUpdatedBlock
   else
     raise Exception.Create(Format('Field not found "%s"', [ABindingName]));
 end;
@@ -605,7 +605,7 @@ begin
 
     for LIdx := LEnd downto LStart do begin
       LBlockChainData := CT_BlockSummary_NUL;
-      LOperationBlock := LNode.Bank.SafeBox.Block(LIdx).blockchainInfo;
+      LOperationBlock := LNode.Bank.SafeBox.GetBlock(LIdx).blockchainInfo;
       LBlockChainData.Block := LOperationBlock.block;
       LBlockChainData.Timestamp := LOperationBlock.timestamp;
       LBlockChainData.BlockProtocolVersion := LOperationBlock.protocol_version;
@@ -623,7 +623,7 @@ begin
       LBlockChainData.MinerPayload := LOperationBlock.block_payload;
       LBlockChainData.PoW := LOperationBlock.proof_of_work;
       LBlockChainData.SafeBoxHash := LOperationBlock.initial_safe_box_hash;
-      LBlockChainData.AccumulatedWork := LNode.Bank.SafeBox.Block(LBlockChainData.Block).AccumulatedWork;
+      LBlockChainData.AccumulatedWork := LNode.Bank.SafeBox.GetBlock(LBlockChainData.Block).AccumulatedWork;
       if (LNode.Bank.LoadOperations(LOperationComp, LIdx)) then begin
         LBlockChainData.OperationsCount := LOperationComp.Count;
         LBlockChainData.Volume := LOperationComp.OperationsHashTree.TotalAmount + LOperationComp.OperationsHashTree.TotalFee;

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZBuyAccount_Details.pas

@@ -70,6 +70,7 @@ uses
   UCrypto,
   UMemory,
   UAccounts,
+  UPCDataTypes,
   USettings,
   UCoreUtils,
   UBaseTypes,

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZChangeAccountInfo.pas

@@ -43,6 +43,7 @@ uses
   UWallet,
   UCommon,
   UAccounts,
+  UPCDataTypes,
   UCoreUtils,
   UWIZOperationSelected,
   UWIZChangeAccountInfo_Details,

+ 18 - 18
src/gui-experimental/wizards/operations/UWIZChangeAccountInfo_Details.lfm

@@ -8,7 +8,7 @@ object WIZChangeAccountInfo_Details: TWIZChangeAccountInfo_Details
   Caption = 'WIZChangeAccountInfo_Details'
   ClientHeight = 379
   ClientWidth = 450
-  Visible = False
+  LCLVersion = '2.0.10.0'
   object gbName: TGroupBox
     Left = 8
     Height = 124
@@ -16,7 +16,7 @@ object WIZChangeAccountInfo_Details: TWIZChangeAccountInfo_Details
     Width = 431
     Anchors = [akTop, akLeft, akRight]
     Caption = 'Name'
-    ClientHeight = 104
+    ClientHeight = 105
     ClientWidth = 427
     TabOrder = 0
     object txtName: TEdit
@@ -35,18 +35,18 @@ object WIZChangeAccountInfo_Details: TWIZChangeAccountInfo_Details
     end
     object lblNameNotice: TLabel
       Left = 16
-      Height = 15
+      Height = 14
       Top = 8
-      Width = 121
+      Width = 130
       Caption = 'Please enter new name'
       ParentColor = False
       ParentFont = False
     end
     object lblNameDetails: TLabel
-      Left = 333
-      Height = 15
+      Left = 329
+      Height = 14
       Top = 8
-      Width = 74
+      Width = 78
       Anchors = [akTop, akRight]
       Caption = 'Name Details'
       Font.Style = [fsBold]
@@ -61,7 +61,7 @@ object WIZChangeAccountInfo_Details: TWIZChangeAccountInfo_Details
     Width = 431
     Anchors = [akTop, akLeft, akRight]
     Caption = 'Type'
-    ClientHeight = 102
+    ClientHeight = 103
     ClientWidth = 427
     ParentFont = False
     TabOrder = 1
@@ -82,17 +82,17 @@ object WIZChangeAccountInfo_Details: TWIZChangeAccountInfo_Details
     end
     object lblTypeNotice: TLabel
       Left = 16
-      Height = 15
+      Height = 14
       Top = 11
-      Width = 114
+      Width = 125
       Caption = 'Please enter new type'
       ParentColor = False
     end
     object lblTypeDetails: TLabel
-      Left = 340
-      Height = 15
+      Left = 333
+      Height = 14
       Top = 8
-      Width = 67
+      Width = 74
       Anchors = [akTop, akRight]
       Caption = 'Type Details'
       Font.Style = [fsBold]
@@ -107,22 +107,22 @@ object WIZChangeAccountInfo_Details: TWIZChangeAccountInfo_Details
     Width = 431
     Anchors = [akTop, akLeft, akRight, akBottom]
     Caption = 'Options'
-    ClientHeight = 69
+    ClientHeight = 70
     ClientWidth = 427
     TabOrder = 2
     object chkCustomFee: TCheckBox
       Left = 16
-      Height = 19
+      Height = 18
       Top = 8
-      Width = 164
+      Width = 174
       Caption = 'Allow me to choose the fee'
       TabOrder = 0
     end
     object chkPayload: TCheckBox
       Left = 16
-      Height = 19
+      Height = 18
       Top = 40
-      Width = 158
+      Width = 163
       Caption = 'Attach a message payload'
       TabOrder = 1
     end

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZChangeAccountInfo_Details.pas

@@ -64,6 +64,7 @@ uses
   UCommon,
   UMemory,
   UAccounts,
+  UPCDataTypes,
   USettings,
   UCoreUtils,
   UBaseTypes,

+ 1 - 1
src/gui-experimental/wizards/operations/UWIZChangeKey.pas

@@ -15,7 +15,7 @@ unit UWIZChangeKey;
 interface
 
 uses
-  Classes, SysUtils, Forms, Dialogs, UCrypto, UCommon, UWizard, UAccounts, UCoreObjects, UWIZOperation, LCLType;
+  Classes, SysUtils, Forms, Dialogs, UCrypto, UCommon, UWizard, UAccounts, UPCDataTypes, UCoreObjects, UWIZOperation, LCLType;
 
 type
 

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZChangeKey_EnterKey.pas

@@ -49,6 +49,7 @@ implementation
 
 uses
   UAccounts,
+  UPCDataTypes,
   USettings,
   UCoreObjects,
   UWIZOperationFee_Custom,

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZChangeKey_SelectKey.pas

@@ -55,6 +55,7 @@ uses
   UCommon,
   UCrypto,
   UAccounts,
+  UPCDataTypes,
   USettings,
   UCoreObjects,
   UWIZOperationFee_Custom,

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZEnlistAccountForSale.pas

@@ -44,6 +44,7 @@ uses
   UCrypto,
   UWallet,
   UAccounts,
+  UPCDataTypes,
   UCoreUtils,
   UCoreObjects,
   UWIZOperationSelected,

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZEnlistAccountForSale_EnterSeller.pas

@@ -54,6 +54,7 @@ uses
   UNode,
   UWallet,
   UAccounts,
+  UPCDataTypes,
   UCoreUtils,
   UBaseTypes,
   UFRMAccountSelect;

+ 1 - 1
src/gui-experimental/wizards/operations/UWIZOperation.pas

@@ -22,7 +22,7 @@ unit UWIZOperation;
 interface
 
 uses
-  Classes, SysUtils, UAccounts, UWallet, UBaseTypes, UCoreObjects;
+  Classes, SysUtils, UAccounts, UWallet, UBaseTypes, UCoreObjects, UPCDataTypes;
 
 type
 

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZOperationConfirmation.pas

@@ -57,6 +57,7 @@ uses
   UWallet,
   UCommon,
   UAccounts,
+  UPCDataTypes,
   UCoreUtils,
   UCoreObjects,
   UCommon.UI,

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZOperationFee_Custom.pas

@@ -57,6 +57,7 @@ implementation
 
 uses
   UAccounts,
+  UPCDataTypes,
   USettings,
   UCoreUtils,
   UCoreObjects,

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZOperationSelected.pas

@@ -56,6 +56,7 @@ uses
   UCoreObjects,
   UCommon.Data,
   UDataSources,
+  UPCDataTypes,
   Generics.Collections;
 
 type

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZOperationSigner_Select.pas

@@ -51,6 +51,7 @@ implementation
 
 uses
   UAccounts,
+  UPCDataTypes,
   UCoreObjects;
 
 { TWIZOperationSigner_Select }

+ 1 - 0
src/gui-experimental/wizards/operations/UWIZSendPASC_Details.pas

@@ -68,6 +68,7 @@ uses
   USettings,
   UCoreUtils,
   UBaseTypes,
+  UPCDataTypes,
   UCoreObjects,
   UBlockChain,
   UFRMAccountSelect,

+ 2 - 1
src/gui-experimental/wizards/wallet/UWIZAddKey_ImportPubKey.pas

@@ -39,7 +39,8 @@ implementation
 {$R *.lfm}
 
 uses
-  UAccounts;
+  UAccounts,
+  UPCDataTypes;
 
 { TWIZAddKey_ImportPubKey }
 

+ 3 - 2
src/libraries/sphere10/UCommon.Collections.pas

@@ -345,6 +345,7 @@ end;
 class function TComparerTool<T>.Many(const comparers: array of IComparer<T>) : IComparer<T>;
 type
   __TArrayTool_IComparer_T = TArrayTool<__IComparer_T>;
+
 begin
   Result := TManyComparer<T>.Create( __TArrayTool_IComparer_T.Copy(comparers) );
 end;
@@ -465,8 +466,8 @@ begin
 end;
 
 class function TPredicateTool<T>.AndMany(const APredicates : array of IPredicate<T>) : IPredicate<T>;
-type
-  __TArrayTool_IPredicate_T = TArrayTool<__IPredicate_T>;
+// type
+//  __TArrayTool_IPredicate_T = TArrayTool<__IPredicate_T>;  // Skybuck: Disabled not needed
 var
   arr : TArray<__IPredicate_T>;
   i : Integer;

+ 13 - 2
src/libraries/sphere10/UCommon.Data.pas

@@ -236,6 +236,7 @@ const
       __IPredicate_T = IPredicate<T>;
       __TList_IPredicate_T = TList<__IPredicate_T>;
     public
+     class function ToArrayWorkAround( ParaList : __TList_IPredicate_T ) : TArray<IPredicate<T>>; // Skybuck: work around for buggy TList.ToArray
      class function ConstructRowComparer(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplySortDelegate<T>) : IComparer<T>;
      class function ConstructRowPredicate(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplyFilterDelegate<T>; const AOperand : TFilterOperand) : IPredicate<T>;
   end;
@@ -659,6 +660,12 @@ begin
   end;
 end;
 
+// Skybuck: ToArrayWorkAround implementation until TList.ToArray is fixed by FPC compiler and/or generics team ?
+class function TDataSourceTool<T>.ToArrayWorkAround( ParaList : __TList_IPredicate_T ) : TArray<IPredicate<T>>;
+begin
+  result := ParaList.ToArray;
+end;
+
 class function TDataSourceTool<T>.ConstructRowPredicate(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplyFilterDelegate<T>; const AOperand : TFilterOperand) : IPredicate<T>;
 type
   __TColumnFilterPredicate_T = TColumnFilterPredicate<T>;
@@ -675,12 +682,16 @@ begin
     end;
   end;
 
+  // Skybuck: Free Pascal Compiler Bug/Internal Error 2015052501 caused by buggy TList.ToArray
   case filters.Count of
     0: Result := nil;
     1: Result := filters[0];
     else case AOperand of
-      foAnd: Result := __TPredicateTool_T.AndMany(filters.ToArray);
-      foOr: Result := __TPredicateTool_T.OrMany(filters.ToArray);
+//      foAnd: Result := __TPredicateTool_T.AndMany(filters.ToArray); // Skybuck: TList.ToArray causes FPC compiler to crash here.
+//      foOr: Result := __TPredicateTool_T.OrMany(filters.ToArray);
+
+      foAnd: Result := __TPredicateTool_T.AndMany(ToArrayWorkAround(filters));
+      foOr: Result := __TPredicateTool_T.OrMany(ToArrayWorkAround(filters));
     end;
   end;
 end;

+ 14 - 12
src/libraries/sphere10/UWizard.pas

@@ -31,7 +31,7 @@ const
 
 type
   { Forward Declarations }
-  TWizardForm<T> = class;
+//  TWizardForm<T> = class; // Skybuck: disabled, not needed anymore.
 
   { Enums }
 
@@ -101,7 +101,7 @@ type
         FHost : TWizardHostForm;
         FStarted : Boolean;
         FFinished : Boolean;
-        FCurrentScreen : TWizardForm<T>;
+        FCurrentScreen : __TScreenType; // Skybuck: Using __TScreenType instead of TWizard<T> solved the FPC Compiler bug !
         FModel : T;
         FScreenPath : TList<TComponentClass>;
         FScreenPathBackup : TDictionary<SizeInt, __TList_TComponentClass>;
@@ -117,16 +117,16 @@ type
         procedure NextHandler(sender : TObject);
         procedure PreviousHandler(sender : TObject);
     protected
-        function CreateScreen(AType: TComponentClass) : TWizardForm<T>;
+        function CreateScreen(AType: TComponentClass) : __TScreenType;
         function DetermineHasNext : boolean; virtual;
         function DetermineHasPrevious : boolean; virtual;
-        procedure PresentScreen(screen : TWizardForm<T>); virtual;
+        procedure PresentScreen(screen : __TScreenType); virtual;
         function FinishRequested(out message : AnsiString) : boolean; virtual; abstract;
         function CancelRequested(out message : AnsiString) : boolean; virtual; abstract;
     public
-        constructor Create(AOwner:TComponent; const screens: array of TComponentClass); overload;
+       constructor Create(AOwner:TComponent; const screens: array of TComponentClass); overload;
         destructor Destroy; override;
-        property CurrentScreen : TWizardForm<T> read FCurrentScreen;
+        property CurrentScreen : __TScreenType read FCurrentScreen;
         property Model : T read FModel;
         property HasNext : boolean read DetermineHasNext;
         property HasPrevious : boolean read DetermineHasPrevious;
@@ -304,7 +304,7 @@ end;
 constructor TWizard<T>.Create(AOwner:TComponent; const screens: array of TComponentClass);
 var
    i : integer;
-   screen : TWizardForm<T>;
+   screen : __TScreenType;
 begin
   inherited Create(AOwner);
   if Length(screens) = 0 then
@@ -328,7 +328,7 @@ end;
 destructor TWizard<T>.Destroy;
 var
   i : integer;
-  screen : TWizardForm<T>;
+  screen : __TScreenType;
   key : TComponentClass;
   backup : TList<TComponentClass>;
 begin
@@ -346,10 +346,10 @@ begin
   // note: Property bag not destroyed, left for user to destroy
 end;
 
-function TWizard<T>.CreateScreen(AType: TComponentClass) : TWizardForm<T>;
+function TWizard<T>.CreateScreen(AType: TComponentClass) : __TScreenType;
 begin
   if NOT FScreenInstances.ContainsKey(AType) then begin
-    Result := TWizardForm<T>(AType.Create(self));
+    Result := __TScreenType(AType.Create(self));
     if Result = nil then
       raise Exception.Create('Supplied type was not correct TWizardForm<T> type');
     Result.UpdatePath := UpdatePath;
@@ -361,7 +361,7 @@ end;
 function TWizard<T>.CalculateFitSize : TPoint;
 var
   maxWidth, maxHeight, i : Integer;
-  screen : TWizardForm<T>;
+  screen : __TScreenType;
 begin
   maxWidth := 0;
   maxHeight := 0;
@@ -489,7 +489,7 @@ begin
   end;
 end;
 
-procedure TWizard<T>.PresentScreen(screen : TWizardForm<T>);
+procedure TWizard<T>.PresentScreen(screen : __TScreenType);
 begin
   FCurrentScreen := screen;
   FCurrentScreen.Model := Model;
@@ -532,6 +532,7 @@ begin
   self.FFinishHandler := finishFunc;
 end;
 
+
 class procedure TActionWizard<T>.Show(AParent: TForm; title, finish: AnsiString; constref bag : T; const screens : array of TComponentClass; cancelFunc: TActionWizardCancelFunc; finishFunc : TActionWizardFinishFunc);
 type
   MyWizard = TActionWizard<T>;
@@ -563,4 +564,5 @@ end;
 
 {%endregion}
 
+
 end.

BIN
src/pascalcoin_wallet_classic.res


+ 18 - 6
src/pascalcoin_wallet_experimental.lpi

@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="12"/>
+    <Version Value="11"/>
     <PathDelim Value="\"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
-        <CompatibilityMode Value="True"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
       <Title Value="PascalCoin Wallet"/>
       <ResourceType Value="res"/>
     </General>
@@ -28,7 +28,7 @@
           </Target>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir);libraries\generics.collections\inc"/>
-            <OtherUnitFiles Value="core;gui-experimental;libraries\synapse;libraries\sphere10;libraries\simplebaselib4pascal;libraries\cryptolib4pascal;libraries\hashlib4pascal;libraries\generics.collections;libraries\pascalcoin;gui-experimental\core.utils;gui-experimental\wizards\wallet;gui-experimental\wizards\operations;gui-classic;libraries\paszlib"/>
+            <OtherUnitFiles Value="core;gui-experimental;libraries\synapse;libraries\abstractmem;\libraries\regex;libraries\sphere10;libraries\simplebaselib4pascal;libraries\cryptolib4pascal;libraries\hashlib4pascal;libraries\generics.collections;libraries\pascalcoin;gui-experimental\core.utils;gui-experimental\wizards\wallet;gui-experimental\wizards\operations;gui-classic;libraries\paszlib;libraries\regex"/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           <Parsing>
@@ -77,7 +77,7 @@
         <PackageName Value="LCL"/>
       </Item1>
     </RequiredPackages>
-    <Units Count="104">
+    <Units Count="107">
       <Unit0>
         <Filename Value="pascalcoin_wallet_experimental.dpr"/>
         <IsPartOfProject Value="True"/>
@@ -642,6 +642,18 @@
         <Filename Value="core\URandomHash2.pas"/>
         <IsPartOfProject Value="True"/>
       </Unit103>
+      <Unit104>
+        <Filename Value="libraries\abstractmem\UAbstractMem.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit104>
+      <Unit105>
+        <Filename Value="core\UEncoding.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit105>
+      <Unit106>
+        <Filename Value="libraries\regex\uregexpr.pas"/>
+        <IsPartOfProject Value="True"/>
+      </Unit106>
     </Units>
   </ProjectOptions>
   <CompilerOptions>
@@ -652,7 +664,7 @@
     </Target>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir);libraries\generics.collections\inc"/>
-      <OtherUnitFiles Value="core;gui-experimental;libraries\simplebaselib4pascal;libraries\hashlib4pascal;libraries\cryptolib4pascal;libraries\synapse;libraries\sphere10;libraries\generics.collections;libraries\pascalcoin;gui-experimental\core.utils;gui-experimental\wizards\wallet;gui-experimental\wizards\operations;libraries\paszlib;gui-classic"/>
+      <OtherUnitFiles Value="core;gui-experimental;libraries\simplebaselib4pascal;libraries\hashlib4pascal;libraries\cryptolib4pascal;libraries\synapse;libraries\sphere10;libraries\generics.collections;libraries\pascalcoin;gui-experimental\core.utils;gui-experimental\wizards\wallet;gui-experimental\wizards\operations;libraries\paszlib;gui-classic;libraries\abstractmem;libraries\regex"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     <Parsing>
@@ -662,7 +674,7 @@
     </Parsing>
     <CodeGeneration>
       <Optimizations>
-        <OptimizationLevel Value="3"/>
+        <OptimizationLevel Value="0"/>
       </Optimizations>
     </CodeGeneration>
     <Linking>