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;
   i: Int32;
 begin
 begin
   Result := #0;
   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);
   i := FRegex.MatchIndexFromName(AGroupName);
   if i >= 0 then begin
   if i >= 0 then begin
     Result := FRegex.Match[i];
     Result := FRegex.Match[i];

+ 1 - 1
src/core/UOpTransaction.pas

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

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

@@ -21,7 +21,7 @@ interface
 uses
 uses
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus,
   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus,
   ExtCtrls, PairSplitter, Buttons, UVisualGrid, UCommon, UCommon.UI, Generics.Collections,
   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
 type
 
 

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

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

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

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

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

@@ -26,7 +26,7 @@ uses
   LCLIntf, LCLType, LMessages,
   LCLIntf, LCLType, LMessages,
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, UAccounts, Grids, StdCtrls, Buttons, ExtCtrls, UCommon.UI,
   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
 const
   CT_AS_MyAccounts = $0001;
   CT_AS_MyAccounts = $0001;
@@ -156,7 +156,7 @@ procedure TSearchThread.BCExecute;
     SetLength(FAccounts,0);
     SetLength(FAccounts,0);
     c := 0;
     c := 0;
     maxC := FSearchValues.SafeBox.AccountsCount-1;
     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
     while (c<=maxC) And (Not Terminated) And (Not FDoStopSearch) do begin
       account := FSearchValues.SafeBox.Account(c);
       account := FSearchValues.SafeBox.Account(c);
       isValid := True;
       isValid := True;
@@ -169,10 +169,10 @@ procedure TSearchThread.BCExecute;
         isValid := TAccountComp.IsAccountForSale(account.accountInfo);
         isValid := TAccountComp.IsAccountForSale(account.accountInfo);
       end;
       end;
       If IsValid and (FSearchValues.onlyForPublicSale) then begin
       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;
       end;
       If IsValid and (FSearchValues.onlyForPrivateSaleToMe) then begin
       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);
           (Assigned(FSearchValues.inWalletKeys)) And (FSearchValues.inWalletKeys.IndexOfAccountKey(account.accountInfo.new_publicKey)>=0);
       end;
       end;
       If IsValid then begin
       If IsValid then begin

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

@@ -27,7 +27,7 @@ uses
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls, UCommon.UI,
   Dialogs, StdCtrls, UCommon.UI,
   UNode, UWallet, UCrypto, Buttons, UBlockChain, UBaseTypes,
   UNode, UWallet, UCrypto, Buttons, UBlockChain, UBaseTypes,
-  UAccounts, UFRMAccountSelect, ActnList, ComCtrls, Types, UCommon, UPCOrderedLists;
+  UAccounts, UFRMAccountSelect, ActnList, ComCtrls, Types, UCommon, UPCOrderedLists, UPCDataTypes;
 
 
 Const
 Const
   CM_PC_WalletKeysChanged = WM_USER + 1;
   CM_PC_WalletKeysChanged = WM_USER + 1;
@@ -143,7 +143,8 @@ type
     FNode : TNode;
     FNode : TNode;
     FWalletKeys: TWalletKeys;
     FWalletKeys: TWalletKeys;
     FDefaultFee: Int64;
     FDefaultFee: Int64;
-    FEncodedPayload : TRawBytes;
+//    FEncodedPayload : TRawBytes;
+    FOperationPayload : TOperationPayload;
     FDisabled : Boolean;
     FDisabled : Boolean;
     FSenderAccounts: TOrderedCardinalList; // TODO: TOrderedCardinalList should be replaced with a "TCardinalList" since signer account should be processed last
     FSenderAccounts: TOrderedCardinalList; // TODO: TOrderedCardinalList should be replaced with a "TCardinalList" since signer account should be processed last
     procedure SetWalletKeys(const Value: TWalletKeys);
     procedure SetWalletKeys(const Value: TWalletKeys);
@@ -178,7 +179,7 @@ implementation
 
 
 uses
 uses
   UPCEncryption,
   UPCEncryption,
-  UCoreUtils, UConst, UOpTransaction, UFRMWalletKeys, UUserInterface, UPCDataTypes;
+  UCoreUtils, UConst, UOpTransaction, UFRMWalletKeys, UUserInterface;
 
 
 {$R *.lfm}
 {$R *.lfm}
 
 
@@ -201,6 +202,11 @@ Var errors : AnsiString;
   _newType : Word;
   _newType : Word;
   _changeName, _changeType, _V2, _executeSigner  : Boolean;
   _changeName, _changeType, _V2, _executeSigner  : Boolean;
   _senderAccounts : TCardinalsArray;
   _senderAccounts : TCardinalsArray;
+  LNewAccountState : TAccountState;
+  LAccountTarget : cardinal;
+  LHashLock : T32Bytes;
+  lChangeData : boolean;
+  LNewData : TRawBytes;
 label loop_start;
 label loop_start;
 begin
 begin
   if Not Assigned(WalletKeys) then raise Exception.Create('No wallet keys');
   if Not Assigned(WalletKeys) then raise Exception.Create('No wallet keys');
@@ -252,7 +258,7 @@ loop_start:
         end;
         end;
         if dooperation then begin
         if dooperation then begin
           op := TOpTransaction.CreateTransaction(FNode.Bank.SafeBox.CurrentProtocol,
           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(_totalamount,_amount);
           inc(_totalfee,_fee);
           inc(_totalfee,_fee);
         end;
         end;
@@ -272,11 +278,11 @@ loop_start:
           if uint64(_totalSignerFee) >= signerAccount.balance then _fee := 0
           if uint64(_totalSignerFee) >= signerAccount.balance then _fee := 0
           else if signerAccount.balance - uint64(_totalSignerFee) > uint64(DefaultFee) then _fee := DefaultFee
           else if signerAccount.balance - uint64(_totalSignerFee) > uint64(DefaultFee) then _fee := DefaultFee
           else _fee := signerAccount.balance - uint64(_totalSignerFee);
           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(_signer_n_ops);
           inc(_totalSignerFee, _fee);
           inc(_totalSignerFee, _fee);
         end else begin
         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;
         end;
         inc(_totalfee,_fee);
         inc(_totalfee,_fee);
         operationstxt := 'Change private key to '+TAccountComp.GetECInfoTxt(_newOwnerPublicKey.EC_OpenSSL_NID);
         operationstxt := 'Change private key to '+TAccountComp.GetECInfoTxt(_newOwnerPublicKey.EC_OpenSSL_NID);
@@ -288,9 +294,11 @@ loop_start:
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         else _fee := signerAccount.balance;
         else _fee := signerAccount.balance;
         if (rbListAccountForPublicSale.Checked) then begin
         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
         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');
         end else raise Exception.Create('Select Sale type');
         {%endregion}
         {%endregion}
       end else if (PageControlOpType.ActivePage = tsDelist) then begin
       end else if (PageControlOpType.ActivePage = tsDelist) then begin
@@ -299,21 +307,22 @@ loop_start:
         // Special fee account:
         // Special fee account:
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         else _fee := signerAccount.balance;
         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}
         {%endregion}
       end else if (PageControlOpType.ActivePage = tsBuyAccount) then begin
       end else if (PageControlOpType.ActivePage = tsBuyAccount) then begin
         {%region Operation: Buy Account}
         {%region Operation: Buy Account}
         if Not UpdateOpBuyAccount(account,accountToBuy,_amount,_newOwnerPublicKey,errors) then raise Exception.Create(errors);
         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,
         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}
         {%endregion}
       end else if (PageControlOpType.ActivePage = tsChangeInfo) then begin
       end else if (PageControlOpType.ActivePage = tsChangeInfo) then begin
         {%region Operation: Change Info}
         {%region Operation: Change Info}
         if not UpdateOpChangeInfo(account,signerAccount,_changeName,_newName,_changeType,_newType,errors) then raise Exception.Create(errors);
         if not UpdateOpChangeInfo(account,signerAccount,_changeName,_newName,_changeType,_newType,errors) then raise Exception.Create(errors);
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         if signerAccount.balance>DefaultFee then _fee := DefaultFee
         else _fee := signerAccount.balance;
         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,
         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}
         {%endregion}
       end else begin
       end else begin
         raise Exception.Create('No operation selected');
         raise Exception.Create('No operation selected');
@@ -1246,7 +1255,7 @@ Var payload_u : AnsiString;
 begin
 begin
   valid := false;
   valid := false;
   payload_encrypted := Nil;
   payload_encrypted := Nil;
-  FEncodedPayload := Nil;
+  FOperationPayload.payload_raw := nil;
   errors := 'Unknown error';
   errors := 'Unknown error';
   payload_u := memoPayload.Lines.Text;
   payload_u := memoPayload.Lines.Text;
   try
   try
@@ -1349,7 +1358,8 @@ begin
       lblEncryptionErrors.Caption := errors;
       lblEncryptionErrors.Caption := errors;
       lblPayloadLength.Caption := Format('(%db -> ?)',[length(payload_u)]);
       lblPayloadLength.Caption := Format('(%db -> ?)',[length(payload_u)]);
     end;
     end;
-    FEncodedPayload := payload_encrypted;
+    FOperationPayload.payload_raw := payload_encrypted;
+
     Result := valid;
     Result := valid;
   end;
   end;
 end;
 end;

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

@@ -84,7 +84,7 @@ type
 
 
 implementation
 implementation
 
 
-uses UConst, USettings, UAccounts, ULog, UCrypto, UFolderHelper, UWallet, UUserInterface, UCommon;
+uses UConst, USettings, UAccounts, ULog, UCrypto, UFolderHelper, UWallet, UUserInterface, UCommon, UNode;
 
 
 {$R *.lfm}
 {$R *.lfm}
 
 
@@ -135,7 +135,13 @@ end;
 
 
 procedure TFRMPascalCoinWalletConfig.bbOpenDataFolderClick(Sender: TObject);
 procedure TFRMPascalCoinWalletConfig.bbOpenDataFolderClick(Sender: TObject);
 begin
 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;
 end;
 
 
 procedure TFRMPascalCoinWalletConfig.bbUpdatePasswordClick(Sender: TObject);
 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 if Value.Fee=0 then lblFee.Font.Color := clGray
     else lblFee.Font.Color := clRed;
     else lblFee.Font.Color := clRed;
     ebOpHash.text := TCrypto.ToHexaString(Value.OperationHash);
     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);
     cbMethodPublicPayload.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.notencrypted'].GetAsBoolean(true);
     cbUsingPrivateKeys.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.usingprivatekeys'].GetAsBoolean(true);
     cbUsingPrivateKeys.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.usingprivatekeys'].GetAsBoolean(true);
     cbUsingPasswords.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.usingpasswords'].GetAsBoolean(true);
     cbUsingPasswords.Checked := TSettings.AppParams.ParamByName['PayloadDecoder.usingpasswords'].GetAsBoolean(true);
@@ -387,7 +387,7 @@ Var raw : TRawBytes;
 begin
 begin
   ok := true;
   ok := true;
   if Assigned(TWallet.Keys) then begin
   if Assigned(TWallet.Keys) then begin
-    raw := FOpResume.OriginalPayload;
+    raw := FOpResume.OriginalPayload.payload_raw;
     if Length(raw)>0 then begin
     if Length(raw)>0 then begin
       // First try to a human readable...
       // First try to a human readable...
       if (cbMethodPublicPayload.Checked) and (TCrypto.IsHumanReadable(raw)) then begin
       if (cbMethodPublicPayload.Checked) and (TCrypto.IsHumanReadable(raw)) then begin

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

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

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

@@ -23,14 +23,14 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, Forms, Dialogs, LCLType, UAccounts, UBlockChain, UNode, UWallet,
   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
 type
 
 
   { TAccountComparer }
   { TAccountComparer }
 
 
   TAccountComparer = class(TComparer<TAccount>)
   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;
     class function DoCompare(constref ALeft, ARight: TAccount): integer; inline;
   end;
   end;
 
 
@@ -47,7 +47,7 @@ type
   { TAccountKeyComparer }
   { TAccountKeyComparer }
 
 
   TAccountKeyComparer = class(TComparer<TAccountKey>)
   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;
     class function DoCompare(constref ALeft, ARight: TAccountKey): integer; inline;
   end;
   end;
 
 
@@ -114,7 +114,8 @@ type
   private
   private
     class function IsOwnerOfWallet(AAccount: TAccount; AWalletKeys: TWalletKeys; out AWalletKey: TWalletKey; var AErrorMessage: string): boolean; static;
     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 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 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;
     class function OthersFinalizeAndDisplayMessage(const AOperationsTxt, AOperationToString: string; ANoOfOperations: integer; ATotalFee: int64; AOperationsHashTree: TOperationsHashTree; var AErrorMessage: string): boolean; static;
   public
   public
@@ -232,7 +233,7 @@ var
   i, j: integer;
   i, j: integer;
   LAccs: TList<TAccount>;
   LAccs: TList<TAccount>;
   LAcc: TAccount;
   LAcc: TAccount;
-  LList: TOrderedCardinalList;
+  LList: TAccountsNumbersList;
   LMemPool: TPCOperationsComp;
   LMemPool: TPCOperationsComp;
   Disposables: TDisposables;
   Disposables: TDisposables;
 begin
 begin
@@ -268,7 +269,7 @@ class function TCoreTool.GetUserAccountNumbers: TArray<cardinal>;
 var
 var
   i, j: integer;
   i, j: integer;
   LAccs: TSortedList<cardinal>;
   LAccs: TSortedList<cardinal>;
-  LList: TOrderedCardinalList;
+  LList: TAccountsNumbersList;
   Disposables: TDisposables;
   Disposables: TDisposables;
 begin
 begin
   LAccs := Disposables.AddObject(TSortedList<cardinal>.Create) as TSortedList<cardinal>;
   LAccs := Disposables.AddObject(TSortedList<cardinal>.Create) as TSortedList<cardinal>;
@@ -478,7 +479,7 @@ var
 
 
   function GetAccountLastUpdateBlock(constref AAccount: TAccount): cardinal;
   function GetAccountLastUpdateBlock(constref AAccount: TAccount): cardinal;
   begin
   begin
-    Result := AAccount.updated_block;
+    Result := AAccount.GetLastUpdatedBlock;
   end;
   end;
 
 
 begin
 begin
@@ -496,8 +497,8 @@ begin
     // if account is modified in block-tip
     // if account is modified in block-tip
     LAcc := LAccounts[i];
     LAcc := LAccounts[i];
     LAccountBalances.AddOrSetValue(LAcc.account, LAcc.Balance);  // track account balances
     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;
   end;
 
 
   // Traverse the set of "last updated" blocks in DESCENDING order
   // Traverse the set of "last updated" blocks in DESCENDING order
@@ -544,7 +545,7 @@ begin
   Result :=
   Result :=
     (ALeft.account = ARight.account) and
     (ALeft.account = ARight.account) and
     (ALeft.balance = ARight.balance) 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
     (ALeft.n_operation = ARight.n_operation) and
     TAccountKeyEqualityComparer.AreEqual(ALeft.accountInfo.accountKey, ARight.accountInfo.accountKey);
     TAccountKeyEqualityComparer.AreEqual(ALeft.accountInfo.accountKey, ARight.accountInfo.accountKey);
 end;
 end;
@@ -556,7 +557,7 @@ end;
 
 
 { TAccountKeyComparer }
 { TAccountKeyComparer }
 
 
-function TAccountKeyComparer.Compare(constref ALeft, ARight: T): integer;
+function TAccountKeyComparer.Compare(constref ALeft, ARight: TAccountKey): integer;
 begin
 begin
   Result := TAccountKeyComparer.DoCompare(ALeft, ARight);
   Result := TAccountKeyComparer.DoCompare(ALeft, ARight);
 end;
 end;
@@ -614,7 +615,8 @@ begin
   builder.Append('');
   builder.Append('');
   builder.Append(Format('Current balance: %s', [TAccountComp.FormatMoney(Self.balance)]));
   builder.Append(Format('Current balance: %s', [TAccountComp.FormatMoney(Self.balance)]));
   builder.Append('');
   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('Public key type: %s', [TAccountComp.GetECInfoTxt(Self.accountInfo.accountKey.EC_OpenSSL_NID)]));
   builder.Append(Format('Base58 Public key: %s', [TAccountComp.AccountPublicKeyExport(Self.accountInfo.accountKey)]));
   builder.Append(Format('Base58 Public key: %s', [TAccountComp.AccountPublicKeyExport(Self.accountInfo.accountKey)]));
   if TAccountComp.IsAccountForSale(Self.accountInfo) then
   if TAccountComp.IsAccountForSale(Self.accountInfo) then
@@ -623,7 +625,9 @@ begin
     builder.Append('** Account is for sale: **');
     builder.Append('** Account is for sale: **');
     builder.Append(Format('Price: %s', [TAccountComp.FormatMoney(Self.accountInfo.price)]));
     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)]));
     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
     begin
       builder.Append('');
       builder.Append('');
       builder.Append('** Private sale **');
       builder.Append('** Private sale **');
@@ -669,12 +673,12 @@ begin
   builder.Add(Format('Operation Hash (ophash): %s', [TCrypto.ToHexaString(Self.OperationHash)]));
   builder.Add(Format('Operation Hash (ophash): %s', [TCrypto.ToHexaString(Self.OperationHash)]));
   if (Self.OperationHash_OLD <> nil) then
   if (Self.OperationHash_OLD <> nil) then
     builder.Add(Format('Old Operation Hash (old_ophash): %s', [TCrypto.ToHexaString(Self.OperationHash_OLD)]));
     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
   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
     if Self.PrintablePayload <> '' then
       builder.Add(Format('Payload (human): %s', [Self.PrintablePayload]));
       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;
   end;
   if Self.Balance >= 0 then
   if Self.Balance >= 0 then
     builder.Add(Format('Final balance: %s', [TAccountComp.FormatMoney(Self.Balance)]));
     builder.Add(Format('Final balance: %s', [TAccountComp.FormatMoney(Self.Balance)]));
@@ -857,6 +861,11 @@ begin
   end;
   end;
 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;
 class function TWIZOperationsHelper.OthersFinalizeAndDisplayMessage(const AOperationsTxt, AOperationToString: string; ANoOfOperations: integer; ATotalFee: int64; AOperationsHashTree: TOperationsHashTree; var AErrorMessage: string): boolean;
 var
 var
   LAuxs, LOperationsTxt: string;
   LAuxs, LOperationsTxt: string;
@@ -921,7 +930,7 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount: TAccount;
   LCurrentAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 begin
 
 
   LWalletKeys := TWallet.Keys;
   LWalletKeys := TWallet.Keys;
@@ -951,7 +960,7 @@ begin
         Exit(False);
         Exit(False);
       end;
       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
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
         Exit(False);
@@ -987,7 +996,7 @@ begin
       if LDoOperation then
       if LDoOperation then
       begin
       begin
         LPCOperation := TOpTransaction.CreateTransaction(
         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
         try
           LTemp := Format('%d. Transfer of %s PASC from %s to %s %s', [LNoOfOperations + 1, TAccountComp.FormatMoney(LAmount), LCurrentAccount.AccountString, ADestinationAccount.AccountString, sLineBreak]);
           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
           if LOperationsTxt <> '' then
@@ -1036,7 +1045,7 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount, LSignerAccount: TAccount;
   LCurrentAccount, LSignerAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
 label
 label
   loop_start;
   loop_start;
 begin
 begin
@@ -1091,7 +1100,7 @@ begin
       else
       else
         LSignerAccount := LCurrentAccount;
         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
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
         Exit(False);
@@ -1119,11 +1128,11 @@ begin
 
 
         LPCOperation := TOpChangeKeySigned.Create(LNode.Bank.Safebox.CurrentProtocol, LSignerAccount.account,
         LPCOperation := TOpChangeKeySigned.Create(LNode.Bank.Safebox.CurrentProtocol, LSignerAccount.account,
           LSignerAccount.n_operation + LNoOfOperations + 1, LCurrentAccount.account,
           LSignerAccount.n_operation + LNoOfOperations + 1, LCurrentAccount.account,
-          LWalletKey.PrivateKey, APublicKey, LFee, LPayloadEncodedBytes);
+          LWalletKey.PrivateKey, APublicKey, LFee, LOperationPayload );
       end
       end
       else
       else
         LPCOperation := TOpChangeKey.Create(LNode.Bank.Safebox.CurrentProtocol, LCurrentAccount.account, LCurrentAccount.n_operation +
         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
       try
         LTemp := Format('%d. Change Key To %s', [LNoOfOperations + 1, TAccountComp.GetECInfoTxt(APublicKey.EC_OpenSSL_NID), sLineBreak]);
         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;
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount, LSignerAccount: TAccount;
   LCurrentAccount, LSignerAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
+  LANewAccountState : TAccountState;
+  LHashLock : T32Bytes;
 begin
 begin
 
 
   LWalletKeys := TWallet.Keys;
   LWalletKeys := TWallet.Keys;
@@ -1236,26 +1247,31 @@ begin
       else
       else
         LFee := LSignerAccount.balance;
         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
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
         Exit(False);
       end;
       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
       case AAccountSaleMode of
         akaPublicSale:
         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,
             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:
         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,
             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
         else
           raise Exception.Create('Invalid Account Sale Type')
           raise Exception.Create('Invalid Account Sale Type')
       end;
       end;
@@ -1306,7 +1322,7 @@ var
   LOperationsTxt, LOperationToString, LTemp: string;
   LOperationsTxt, LOperationToString, LTemp: string;
   LAccountIdx, LNoOfOperations: integer;
   LAccountIdx, LNoOfOperations: integer;
   LCurrentAccount, LSignerAccount: TAccount;
   LCurrentAccount, LSignerAccount: TAccount;
-  LPayloadEncodedBytes: TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 begin
 
 
   LWalletKeys := TWallet.Keys;
   LWalletKeys := TWallet.Keys;
@@ -1366,7 +1382,7 @@ begin
       else
       else
         LFee := LSignerAccount.balance;
         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
       begin
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         AErrorMessage := Format('Error Encoding Payload Of Selected Account "%s. ", Specific Error Is "%s"', [LCurrentAccount.AccountString, AErrorMessage]);
         Exit(False);
         Exit(False);
@@ -1374,7 +1390,7 @@ begin
 
 
       LPCOperation := TOpDelistAccountForSale.CreateDelistAccountForSale(LNode.Bank.Safebox.CurrentProtocol,
       LPCOperation := TOpDelistAccountForSale.CreateDelistAccountForSale(LNode.Bank.Safebox.CurrentProtocol,
         LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx, LCurrentAccount.account, LFee, LWalletKey.PrivateKey,
         LSignerAccount.account, LSignerAccount.n_operation + 1 + LAccountIdx, LCurrentAccount.account, LFee, LWalletKey.PrivateKey,
-        LPayloadEncodedBytes);
+        LOperationPayload);
 
 
       try
       try
         LTemp := Format('%d. Delist Account %s From Sale %s', [LNoOfOperations + 1, LCurrentAccount.DisplayString, sLineBreak]);
         LTemp := Format('%d. Delist Account %s From Sale %s', [LNoOfOperations + 1, LCurrentAccount.DisplayString, sLineBreak]);
@@ -1424,6 +1440,9 @@ var
   LCurrentAccount, LSignerAccount: TAccount;
   LCurrentAccount, LSignerAccount: TAccount;
   LPayloadEncodedBytes, LNewName: TRawBytes;
   LPayloadEncodedBytes, LNewName: TRawBytes;
   LChangeType, LChangeName: boolean;
   LChangeType, LChangeName: boolean;
+  LChangeData : boolean;
+  LNewData : TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 begin
 
 
   LWalletKeys := TWallet.Keys;
   LWalletKeys := TWallet.Keys;
@@ -1523,10 +1542,9 @@ begin
         Exit(False);
         Exit(False);
       end;
       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,
         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
       try
         if (LChangeName) and (LChangeType) then
         if (LChangeName) and (LChangeType) then
@@ -1587,6 +1605,7 @@ var
   LAccountIdx, LNoOfOperations, LAccNumberIndex: integer;
   LAccountIdx, LNoOfOperations, LAccNumberIndex: integer;
   LCurrentAccount, LSignerAccount: TAccount;
   LCurrentAccount, LSignerAccount: TAccount;
   LPayloadEncodedBytes, LNewName: TRawBytes;
   LPayloadEncodedBytes, LNewName: TRawBytes;
+  LOperationPayload : TOperationPayload;
 begin
 begin
 
 
   LWalletKeys := TWallet.Keys;
   LWalletKeys := TWallet.Keys;
@@ -1644,8 +1663,9 @@ begin
         Exit(False);
         Exit(False);
       end;
       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,
       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
       try
       LTemp := Format('%d. Buy Account %s for %s PASC %s', [LNoOfOperations + 1, AAccountToBuy.AccountString, TAccountComp.FormatMoney(AAmount), sLineBreak]);
       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
 uses
   Classes, SysUtils, UAccounts, UNode, UBlockchain, UCrypto, UCoreObjects,
   Classes, SysUtils, UAccounts, UNode, UBlockchain, UCrypto, UCoreObjects,
   UCommon, UMemory, UConst, UCommon.Data, UCoreUtils, UBaseTypes,
   UCommon, UMemory, UConst, UCommon.Data, UCoreUtils, UBaseTypes,
-  UCommon.Collections, Generics.Collections, Generics.Defaults, syncobjs;
+  UCommon.Collections, Generics.Collections, Generics.Defaults, syncobjs, UPCDataTypes;
 
 
 type
 type
 
 
@@ -189,7 +189,7 @@ begin
   else if ABindingName = 'NOperation' then
   else if ABindingName = 'NOperation' then
     Result := AItem.n_operation
     Result := AItem.n_operation
   else if ABindingName = 'LastUpdatedBlock' then
   else if ABindingName = 'LastUpdatedBlock' then
-    Result := AItem.updated_block
+    Result := AItem.GetLastUpdatedBlock
   else
   else
     raise Exception.Create(Format('Field not found "%s"', [ABindingName]));
     raise Exception.Create(Format('Field not found "%s"', [ABindingName]));
 end;
 end;
@@ -605,7 +605,7 @@ begin
 
 
     for LIdx := LEnd downto LStart do begin
     for LIdx := LEnd downto LStart do begin
       LBlockChainData := CT_BlockSummary_NUL;
       LBlockChainData := CT_BlockSummary_NUL;
-      LOperationBlock := LNode.Bank.SafeBox.Block(LIdx).blockchainInfo;
+      LOperationBlock := LNode.Bank.SafeBox.GetBlock(LIdx).blockchainInfo;
       LBlockChainData.Block := LOperationBlock.block;
       LBlockChainData.Block := LOperationBlock.block;
       LBlockChainData.Timestamp := LOperationBlock.timestamp;
       LBlockChainData.Timestamp := LOperationBlock.timestamp;
       LBlockChainData.BlockProtocolVersion := LOperationBlock.protocol_version;
       LBlockChainData.BlockProtocolVersion := LOperationBlock.protocol_version;
@@ -623,7 +623,7 @@ begin
       LBlockChainData.MinerPayload := LOperationBlock.block_payload;
       LBlockChainData.MinerPayload := LOperationBlock.block_payload;
       LBlockChainData.PoW := LOperationBlock.proof_of_work;
       LBlockChainData.PoW := LOperationBlock.proof_of_work;
       LBlockChainData.SafeBoxHash := LOperationBlock.initial_safe_box_hash;
       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
       if (LNode.Bank.LoadOperations(LOperationComp, LIdx)) then begin
         LBlockChainData.OperationsCount := LOperationComp.Count;
         LBlockChainData.OperationsCount := LOperationComp.Count;
         LBlockChainData.Volume := LOperationComp.OperationsHashTree.TotalAmount + LOperationComp.OperationsHashTree.TotalFee;
         LBlockChainData.Volume := LOperationComp.OperationsHashTree.TotalAmount + LOperationComp.OperationsHashTree.TotalFee;

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

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

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

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

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

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

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

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

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

@@ -15,7 +15,7 @@ unit UWIZChangeKey;
 interface
 interface
 
 
 uses
 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
 type
 
 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -39,7 +39,8 @@ implementation
 {$R *.lfm}
 {$R *.lfm}
 
 
 uses
 uses
-  UAccounts;
+  UAccounts,
+  UPCDataTypes;
 
 
 { TWIZAddKey_ImportPubKey }
 { 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>;
 class function TComparerTool<T>.Many(const comparers: array of IComparer<T>) : IComparer<T>;
 type
 type
   __TArrayTool_IComparer_T = TArrayTool<__IComparer_T>;
   __TArrayTool_IComparer_T = TArrayTool<__IComparer_T>;
+
 begin
 begin
   Result := TManyComparer<T>.Create( __TArrayTool_IComparer_T.Copy(comparers) );
   Result := TManyComparer<T>.Create( __TArrayTool_IComparer_T.Copy(comparers) );
 end;
 end;
@@ -465,8 +466,8 @@ begin
 end;
 end;
 
 
 class function TPredicateTool<T>.AndMany(const APredicates : array of IPredicate<T>) : IPredicate<T>;
 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
 var
   arr : TArray<__IPredicate_T>;
   arr : TArray<__IPredicate_T>;
   i : Integer;
   i : Integer;

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

@@ -236,6 +236,7 @@ const
       __IPredicate_T = IPredicate<T>;
       __IPredicate_T = IPredicate<T>;
       __TList_IPredicate_T = TList<__IPredicate_T>;
       __TList_IPredicate_T = TList<__IPredicate_T>;
     public
     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 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>;
      class function ConstructRowPredicate(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplyFilterDelegate<T>; const AOperand : TFilterOperand) : IPredicate<T>;
   end;
   end;
@@ -659,6 +660,12 @@ begin
   end;
   end;
 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>;
 class function TDataSourceTool<T>.ConstructRowPredicate(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplyFilterDelegate<T>; const AOperand : TFilterOperand) : IPredicate<T>;
 type
 type
   __TColumnFilterPredicate_T = TColumnFilterPredicate<T>;
   __TColumnFilterPredicate_T = TColumnFilterPredicate<T>;
@@ -675,12 +682,16 @@ begin
     end;
     end;
   end;
   end;
 
 
+  // Skybuck: Free Pascal Compiler Bug/Internal Error 2015052501 caused by buggy TList.ToArray
   case filters.Count of
   case filters.Count of
     0: Result := nil;
     0: Result := nil;
     1: Result := filters[0];
     1: Result := filters[0];
     else case AOperand of
     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;
   end;
 end;
 end;

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

@@ -31,7 +31,7 @@ const
 
 
 type
 type
   { Forward Declarations }
   { Forward Declarations }
-  TWizardForm<T> = class;
+//  TWizardForm<T> = class; // Skybuck: disabled, not needed anymore.
 
 
   { Enums }
   { Enums }
 
 
@@ -101,7 +101,7 @@ type
         FHost : TWizardHostForm;
         FHost : TWizardHostForm;
         FStarted : Boolean;
         FStarted : Boolean;
         FFinished : Boolean;
         FFinished : Boolean;
-        FCurrentScreen : TWizardForm<T>;
+        FCurrentScreen : __TScreenType; // Skybuck: Using __TScreenType instead of TWizard<T> solved the FPC Compiler bug !
         FModel : T;
         FModel : T;
         FScreenPath : TList<TComponentClass>;
         FScreenPath : TList<TComponentClass>;
         FScreenPathBackup : TDictionary<SizeInt, __TList_TComponentClass>;
         FScreenPathBackup : TDictionary<SizeInt, __TList_TComponentClass>;
@@ -117,16 +117,16 @@ type
         procedure NextHandler(sender : TObject);
         procedure NextHandler(sender : TObject);
         procedure PreviousHandler(sender : TObject);
         procedure PreviousHandler(sender : TObject);
     protected
     protected
-        function CreateScreen(AType: TComponentClass) : TWizardForm<T>;
+        function CreateScreen(AType: TComponentClass) : __TScreenType;
         function DetermineHasNext : boolean; virtual;
         function DetermineHasNext : boolean; virtual;
         function DetermineHasPrevious : 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 FinishRequested(out message : AnsiString) : boolean; virtual; abstract;
         function CancelRequested(out message : AnsiString) : boolean; virtual; abstract;
         function CancelRequested(out message : AnsiString) : boolean; virtual; abstract;
     public
     public
-        constructor Create(AOwner:TComponent; const screens: array of TComponentClass); overload;
+       constructor Create(AOwner:TComponent; const screens: array of TComponentClass); overload;
         destructor Destroy; override;
         destructor Destroy; override;
-        property CurrentScreen : TWizardForm<T> read FCurrentScreen;
+        property CurrentScreen : __TScreenType read FCurrentScreen;
         property Model : T read FModel;
         property Model : T read FModel;
         property HasNext : boolean read DetermineHasNext;
         property HasNext : boolean read DetermineHasNext;
         property HasPrevious : boolean read DetermineHasPrevious;
         property HasPrevious : boolean read DetermineHasPrevious;
@@ -304,7 +304,7 @@ end;
 constructor TWizard<T>.Create(AOwner:TComponent; const screens: array of TComponentClass);
 constructor TWizard<T>.Create(AOwner:TComponent; const screens: array of TComponentClass);
 var
 var
    i : integer;
    i : integer;
-   screen : TWizardForm<T>;
+   screen : __TScreenType;
 begin
 begin
   inherited Create(AOwner);
   inherited Create(AOwner);
   if Length(screens) = 0 then
   if Length(screens) = 0 then
@@ -328,7 +328,7 @@ end;
 destructor TWizard<T>.Destroy;
 destructor TWizard<T>.Destroy;
 var
 var
   i : integer;
   i : integer;
-  screen : TWizardForm<T>;
+  screen : __TScreenType;
   key : TComponentClass;
   key : TComponentClass;
   backup : TList<TComponentClass>;
   backup : TList<TComponentClass>;
 begin
 begin
@@ -346,10 +346,10 @@ begin
   // note: Property bag not destroyed, left for user to destroy
   // note: Property bag not destroyed, left for user to destroy
 end;
 end;
 
 
-function TWizard<T>.CreateScreen(AType: TComponentClass) : TWizardForm<T>;
+function TWizard<T>.CreateScreen(AType: TComponentClass) : __TScreenType;
 begin
 begin
   if NOT FScreenInstances.ContainsKey(AType) then begin
   if NOT FScreenInstances.ContainsKey(AType) then begin
-    Result := TWizardForm<T>(AType.Create(self));
+    Result := __TScreenType(AType.Create(self));
     if Result = nil then
     if Result = nil then
       raise Exception.Create('Supplied type was not correct TWizardForm<T> type');
       raise Exception.Create('Supplied type was not correct TWizardForm<T> type');
     Result.UpdatePath := UpdatePath;
     Result.UpdatePath := UpdatePath;
@@ -361,7 +361,7 @@ end;
 function TWizard<T>.CalculateFitSize : TPoint;
 function TWizard<T>.CalculateFitSize : TPoint;
 var
 var
   maxWidth, maxHeight, i : Integer;
   maxWidth, maxHeight, i : Integer;
-  screen : TWizardForm<T>;
+  screen : __TScreenType;
 begin
 begin
   maxWidth := 0;
   maxWidth := 0;
   maxHeight := 0;
   maxHeight := 0;
@@ -489,7 +489,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TWizard<T>.PresentScreen(screen : TWizardForm<T>);
+procedure TWizard<T>.PresentScreen(screen : __TScreenType);
 begin
 begin
   FCurrentScreen := screen;
   FCurrentScreen := screen;
   FCurrentScreen.Model := Model;
   FCurrentScreen.Model := Model;
@@ -532,6 +532,7 @@ begin
   self.FFinishHandler := finishFunc;
   self.FFinishHandler := finishFunc;
 end;
 end;
 
 
+
 class procedure TActionWizard<T>.Show(AParent: TForm; title, finish: AnsiString; constref bag : T; const screens : array of TComponentClass; cancelFunc: TActionWizardCancelFunc; finishFunc : TActionWizardFinishFunc);
 class procedure TActionWizard<T>.Show(AParent: TForm; title, finish: AnsiString; constref bag : T; const screens : array of TComponentClass; cancelFunc: TActionWizardCancelFunc; finishFunc : TActionWizardFinishFunc);
 type
 type
   MyWizard = TActionWizard<T>;
   MyWizard = TActionWizard<T>;
@@ -563,4 +564,5 @@ end;
 
 
 {%endregion}
 {%endregion}
 
 
+
 end.
 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"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
 <CONFIG>
   <ProjectOptions>
   <ProjectOptions>
-    <Version Value="12"/>
+    <Version Value="11"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <General>
     <General>
       <Flags>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
-        <CompatibilityMode Value="True"/>
       </Flags>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
+      <MainUnit Value="0"/>
       <Title Value="PascalCoin Wallet"/>
       <Title Value="PascalCoin Wallet"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
     </General>
     </General>
@@ -28,7 +28,7 @@
           </Target>
           </Target>
           <SearchPaths>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir);libraries\generics.collections\inc"/>
             <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)"/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           </SearchPaths>
           <Parsing>
           <Parsing>
@@ -77,7 +77,7 @@
         <PackageName Value="LCL"/>
         <PackageName Value="LCL"/>
       </Item1>
       </Item1>
     </RequiredPackages>
     </RequiredPackages>
-    <Units Count="104">
+    <Units Count="107">
       <Unit0>
       <Unit0>
         <Filename Value="pascalcoin_wallet_experimental.dpr"/>
         <Filename Value="pascalcoin_wallet_experimental.dpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
@@ -642,6 +642,18 @@
         <Filename Value="core\URandomHash2.pas"/>
         <Filename Value="core\URandomHash2.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
       </Unit103>
       </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>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
@@ -652,7 +664,7 @@
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir);libraries\generics.collections\inc"/>
       <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)"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     </SearchPaths>
     <Parsing>
     <Parsing>
@@ -662,7 +674,7 @@
     </Parsing>
     </Parsing>
     <CodeGeneration>
     <CodeGeneration>
       <Optimizations>
       <Optimizations>
-        <OptimizationLevel Value="3"/>
+        <OptimizationLevel Value="0"/>
       </Optimizations>
       </Optimizations>
     </CodeGeneration>
     </CodeGeneration>
     <Linking>
     <Linking>