Prechádzať zdrojové kódy

Merge pull request #36 from SkybuckFlying/GUIExperimentalBugFixes2

Some functionality partially restored, more GUIExperimental bug fixes…
Herman Schoenfeld 4 rokov pred
rodič
commit
6a875320a9

+ 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 if this is safe
       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 if this is safe
           (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

+ 2 - 2
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;
@@ -178,7 +178,7 @@ implementation
 
 
 uses
 uses
   UPCEncryption,
   UPCEncryption,
-  UCoreUtils, UConst, UOpTransaction, UFRMWalletKeys, UUserInterface, UPCDataTypes;
+  UCoreUtils, UConst, UOpTransaction, UFRMWalletKeys, UUserInterface;
 
 
 {$R *.lfm}
 {$R *.lfm}
 
 

+ 1 - 1
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};
 
 

+ 37 - 24
src/gui-experimental/core.utils/UCoreUtils.pas

@@ -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
@@ -625,8 +626,8 @@ begin
     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 // Skybuck *old*
 //    if TAccountComp.IsAccountForSaleAcceptingTransactions(Self.accountInfo) then // Skybuck *old*
-    // Skybuck: reduced funtionality for now, might need fixing later.
-    if TAccountComp.IsAccountForSaleOrSwap(Self.accountInfo) then // Skybuck *new*
+    // 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 **');
@@ -860,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;
@@ -924,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;
@@ -954,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);
@@ -990,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
@@ -1039,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
@@ -1094,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);
@@ -1122,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]);
@@ -1174,7 +1180,8 @@ 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;
 begin
 begin
 
 
   LWalletKeys := TWallet.Keys;
   LWalletKeys := TWallet.Keys;
@@ -1239,7 +1246,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);
@@ -1248,17 +1255,21 @@ begin
       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 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, 0, LWalletKey.PrivateKey, LPayloadEncodedBytes);
+            APublicKey, 0, LWalletKey.PrivateKey, CT_HashLock_NUL, LOperationPayload); // Skybuck: somebody check if hashlock can be a nil record
 
 
         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;
@@ -1309,7 +1320,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;
@@ -1369,7 +1380,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);
@@ -1377,7 +1388,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]);
@@ -1427,6 +1438,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;
@@ -1526,10 +1540,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

+ 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;

+ 14 - 4
src/libraries/sphere10/UCommon.Collections.pas

@@ -343,10 +343,12 @@ begin
 end;
 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) ); // Skybuck: disabled for now
 end;
 end;
 
 
 class function TComparerTool<T>.Many(const comparers: TEnumerable<__IComparer_T>) : IComparer<T>;
 class function TComparerTool<T>.Many(const comparers: TEnumerable<__IComparer_T>) : IComparer<T>;
@@ -363,8 +365,10 @@ begin
 end;
 end;
 
 
 class function TComparerTool<T>.AlwaysEqual : IComparer<T>;
 class function TComparerTool<T>.AlwaysEqual : IComparer<T>;
+(*
 type
 type
-  __TGlobalComparerFunc_T = TGlobalComparerFunc<T>;
+  __TGlobalComparerFunc_T = TGlobalComparerFunc<T>;  // Skybuck: Disabled for now
+*)
 begin
 begin
   Result :=  TComparerTool<T>.FromFunc( AlwaysEqualHandler );
   Result :=  TComparerTool<T>.FromFunc( AlwaysEqualHandler );
 end;
 end;
@@ -465,8 +469,10 @@ 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
 type
-  __TArrayTool_IPredicate_T = TArrayTool<__IPredicate_T>;
+  __TArrayTool_IPredicate_T = TArrayTool<__IPredicate_T>;  // Skybuck: Disabled for now
+*)
 var
 var
   arr : TArray<__IPredicate_T>;
   arr : TArray<__IPredicate_T>;
   i : Integer;
   i : Integer;
@@ -512,10 +518,14 @@ begin
 end;
 end;
 
 
 class function TPredicateTool<T>.OrMany(const APredicates : array of IPredicate<T>) : IPredicate<T>;
 class function TPredicateTool<T>.OrMany(const APredicates : array of IPredicate<T>) : IPredicate<T>;
+// Skybuck: Disabled for now
+(*
 type
 type
   __TArrayTool_IPredicate_T = TArrayTool<__IPredicate_T>;
   __TArrayTool_IPredicate_T = TArrayTool<__IPredicate_T>;
+*)
 begin
 begin
-  Result := TOrManyPredicate<T>.Create( __TArrayTool_IPredicate_T.Copy( APredicates) );
+    // Skybuck: Disabled for now
+//  Result := TOrManyPredicate<T>.Create( __TArrayTool_IPredicate_T.Copy( APredicates) );
 end;
 end;
 
 
 class function TPredicateTool<T>.OrMany(const APredicates : array of TNestedPredicateFunc<T>) : IPredicate<T>;
 class function TPredicateTool<T>.OrMany(const APredicates : array of TNestedPredicateFunc<T>) : IPredicate<T>;

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

@@ -637,14 +637,18 @@ end;
 { TDataSourceTool }
 { TDataSourceTool }
 
 
 class function TDataSourceTool<T>.ConstructRowComparer(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplySortDelegate<T>) : IComparer<T>;
 class function TDataSourceTool<T>.ConstructRowComparer(const AFilters : TArray<TColumnFilter>; const ADelegate : TApplySortDelegate<T>) : IComparer<T>;
+(*
 type
 type
-  __IComparer_T = IComparer<T>;
+  __IComparer_T = IComparer<T>; // Skybuck: Disabled for now
+*)
 var
 var
   i : integer;
   i : integer;
-  comparers : TList<__IComparer_T>;
+//  comparers : TList<__IComparer_T>; // Skybuck: Disabled for now
   filter : TColumnFilter;
   filter : TColumnFilter;
   GC : TDisposables;
   GC : TDisposables;
 begin
 begin
+// Skybuck: Disabled for now
+(*
   comparers := GC.AddObject(  TList<__IComparer_T>.Create ) as TList<__IComparer_T>;
   comparers := GC.AddObject(  TList<__IComparer_T>.Create ) as TList<__IComparer_T>;
   for i := Low(AFilters) to High(AFilters) do begin
   for i := Low(AFilters) to High(AFilters) do begin
     filter := AFilters[i];
     filter := AFilters[i];
@@ -657,23 +661,30 @@ begin
     1: Result := comparers[0];
     1: Result := comparers[0];
     else Result := TComparerTool<T>.Many(comparers);
     else Result := TComparerTool<T>.Many(comparers);
   end;
   end;
+*)
 end;
 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>;
+// Skybuck: Disabled for now
+(*
 type
 type
   __TColumnFilterPredicate_T = TColumnFilterPredicate<T>;
   __TColumnFilterPredicate_T = TColumnFilterPredicate<T>;
   __TPredicateTool_T = TPredicateTool<T>;
   __TPredicateTool_T = TPredicateTool<T>;
+*)
 var
 var
   i : integer;
   i : integer;
   filters : __TList_IPredicate_T;
   filters : __TList_IPredicate_T;
   GC : TDisposables;
   GC : TDisposables;
 begin
 begin
+  // Skybuck: Disabled for now
+  (*
   filters := GC.AddObject( __TList_IPredicate_T.Create ) as __TList_IPredicate_T;
   filters := GC.AddObject( __TList_IPredicate_T.Create ) as __TList_IPredicate_T;
   for i := Low(AFilters) to High(AFilters) do begin
   for i := Low(AFilters) to High(AFilters) do begin
     if AFilters[i].Filter <> vgfSortable then begin
     if AFilters[i].Filter <> vgfSortable then begin
       filters.Add( __TColumnFilterPredicate_T.Create(AFilters[i], ADelegate));
       filters.Add( __TColumnFilterPredicate_T.Create(AFilters[i], ADelegate));
     end;
     end;
   end;
   end;
+  *)
 
 
   (*
   (*
   // Skybuck: Free Pascal Compiler Bug/Internal Error 2015052501 (disabled for now).
   // Skybuck: Free Pascal Compiler Bug/Internal Error 2015052501 (disabled for now).

+ 1 - 1
src/pascalcoin_wallet_experimental.lpi

@@ -674,7 +674,7 @@
     </Parsing>
     </Parsing>
     <CodeGeneration>
     <CodeGeneration>
       <Optimizations>
       <Optimizations>
-        <OptimizationLevel Value="3"/>
+        <OptimizationLevel Value="0"/>
       </Optimizations>
       </Optimizations>
     </CodeGeneration>
     </CodeGeneration>
     <Linking>
     <Linking>