Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

High Priority - Verify a Transaction #306

Closed
lock9 opened this issue Aug 14, 2018 · 1 comment
Closed

High Priority - Verify a Transaction #306

lock9 opened this issue Aug 14, 2018 · 1 comment

Comments

@lock9
Copy link
Contributor

lock9 commented Aug 14, 2018

In the current code, the Verify method is always returning true instead of checking the validity of the transaction.
This is necessary to achieve the goal of making a relay node.

aboimpinto added a commit to aboimpinto/neo-sharp that referenced this issue Sep 13, 2018
…itness. Transaction, BlockHeader and Block OperationManager classes.

In this classes the verify method will be implemented.

CityOfZion#306, CityOfZion#307
osmirnov pushed a commit that referenced this issue Sep 14, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.
osmirnov pushed a commit that referenced this issue Sep 16, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.
osmirnov pushed a commit that referenced this issue Sep 18, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment
@melanke
Copy link
Contributor

melanke commented Sep 20, 2018

I am working on this issue

melanke pushed a commit to simplitech/neo-sharp that referenced this issue Sep 21, 2018
osmirnov pushed a commit that referenced this issue Sep 25, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* * Remove IContainer from the MessageHandlerProxy. All handlers are now injected in the contructor
* Strategy pattern used to find what MessageHandler should process the message.

* Adding more debug messages and minor validations.
remove comment code from MessageHandlerProxy

* Remove comment code and clean up the usings

* Replace Blockchain class dependencies with BlockchainContext.

#426

* NeoSharp.SyncMVP removed

* Remove NetworkStream.Dispose because it's already called called during the dispose.

* refactor the Handle method to remove the foreach and nested if statement

* add appsetting.neo-privnet.json

* Missing cleanup when <object>OperationManager classes were introduced.

* Cleanup the registration of the message handlers and MessageHandlerProxy has his own interface now.

* Registration of MessageHandler is now singleton as requested by @osmirnov
#427

* NeedPeerSync and IsSync properties added to BlockchainContext

* MessageHandlers are type safe. The solution was to use an interface and an abstract class.

#427

* remove example commented code

* merge with development

* merge with development
osmirnov pushed a commit that referenced this issue Sep 29, 2018
…r references (#449)

* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository
osmirnov pushed a commit that referenced this issue Sep 29, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.
shargon pushed a commit that referenced this issue Oct 1, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.
shargon pushed a commit that referenced this issue Oct 3, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fix: when retrieve from RedisDb the convertion from string to hash if fixed.

* Update ECPoint.cs

* Real Infinity
shargon pushed a commit that referenced this issue Oct 3, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* update NEO-privnet settings

* add the verification point.Length == 0

* Update ECPoint.cs
shargon pushed a commit that referenced this issue Oct 3, 2018
… was not correct and fix unit tests (#469)

* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* Update MessageHandlerProxy.cs

We can discuss this point in other PR, now we need to fix the ut

* Update MessageHandlerProxy.cs
gubanotorious pushed a commit that referenced this issue Oct 3, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* projects to be extract from code added to the solution

* Cryptography and one extension method extracted from core that going to be shared.

* Formating classes in Core\Cryptography

* extract Types and Cryptography from core

* Fix unit tests, loading the new types assembly for deserialization
osmirnov pushed a commit that referenced this issue Oct 4, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* Update MessageHandlerProxy.cs

We can discuss this point in other PR, now we need to fix the ut

* Update MessageHandlerProxy.cs

* Cleanup BlockHeerPersister and BlockPersister.
Code is cleaner and with less dependencies.
Remove if statetements, rename methods, remove event and inject BlockchainContext
osmirnov pushed a commit that referenced this issue Oct 5, 2018
* RocksDbRepository reach 42% cover

* Rename abstract class ICrypto to Crypto. I'm sure this was once an interface but it's not anymore, threfore should not carry the prefix "I" that identify the interfaces.

* fix some merge problems

* Increase Server tests coverage to 94%.
Black listed peers try to connect test

* fix merge issues

* * Remove protected fields from TestBase and replace with overload usage of the method RandomInt.
* Small clean up on the UtCrypto

* Create UtBlockchain and create first tests.
more tests will be added soon!

* fix issues from the merge

* Adding testing information to the team Contributing page.

* Small CleanUp the test class with properties that aren't been used anymore.

* UtBlockChain: InitializeBlockchain_IsGenesisBlock_InitializeComplete

* Firsts UtBlockProcessor tests

* AddBlock tests added

* * UtBlockProcessor: Run test
* Fix an inverted if logic. The code only enter in the While loop if the cancellation was requested and should be the other way around.

* Cleanup
* Replace BlockProcessor dependency from Prompt and replace with IBlockPool
* Remove unused properties from BlockProcessor
*  ContainsBlock method in BlockProcessor signature changed to Private because is not used anywhere else but internally

* UtBlockProcessor - Loop test: When the received block is not the expected next.

* Remove comment

* Remove async modifier from methods that aren't implemented

* .

* Merge branch 'development' of https://github.com/aboimpinto/neo-sharp into development

* Add test class, #301

* Write tests for Add method.
#301

* Refactor the Block / BlockHeader in Signed and Unsigned objects (mutable and immutable).
The intenstion of this refactor is to bring better readability of the code and remove logic code from the DTO.

* Implement the UpdateHash methods in the creation of the Signed<object>

* Signed and Unsigned strucuture return GenenisBlock

* Draft of the BinaryCustomSeralization of TransactionBase

* Revert "Remove stack logs (#321)"

This reverts commit 34c676a.

* Add BlockOperationsManager and WitnessOperationManager that will be resposable to Sign and Verify the block and the witness

* Initial work, removing logic from the model objects and add it into Witness. Transaction, BlockHeader and Block OperationManager classes.
In this classes the verify method will be implemented.

#306, #307

* Cleanup and remove code that was not merged.

* regreassion test for the case where the current block is null. This happen when the node start without genesis block.

* Remove dependencies from BlockProcessor and remove BlockHeader references. BlockProcessor use only Block object.
#350, #351

* now the Persist consider the genesis block for the case of start a node in a clean environment

* consolidate the TransactionSigner and TransactionVerigy into OperationsManager

* .

* Make Genesis and Genesis assets instatiable instead of static classes

* UtGenesis refactored to use Generis and GenesisAssets instances

* IBlockchain dependency removed from some of the MessageHandlers
#434

* Replace IServer reference with IServerContext to avoid Circular References

#433

* Adjust the code to BlockSigner / BlockVerifier pattern

* Rename the Model classes to Repository

* Genesis class renamed to GenesisBuilder.

* rename IGenesis to IGenenisBuilder and IGenesisAssets to IGenesisAssetsBuilder and clean up the comment and not used method in Blockchain class. All BlockModel variables were renamed to BlockRepository

* replace IRepository dependency with IBlockRepository

* Implement ISignerT and IVerifierT concept discussed with @melanke

* fixing red test. missing registration.

* Remove some exception throw because they are getting swallow by async/await pattern and all the BlockHeader now have the type = header.

* Fixing unit test

* remove assignment of the Block Type as header. The Serialization is doign that now.

* Fixing JSON deserialization in case of the of GenesisBlock that we owner is serialized as Infinity.

* Fixing unit tests

* Update MessageHandlerProxy.cs

We can discuss this point in other PR, now we need to fix the ut

* Update MessageHandlerProxy.cs

* Cleanup BlockHeerPersister and BlockPersister.
Code is cleaner and with less dependencies.
Remove if statetements, rename methods, remove event and inject BlockchainContext

* Add UtBlockHeaderPersister and remove the block header validation to another class making the persister code smaller and cleaner.

#480
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants